#include <unistd.h> long pathconf(const char *filename, int name);
This function returns various system-dependent configuration values. The name is one of the following:
_PC_LINK_MAX
_PC_MAX_CANON
_PC_MAX_INPUT
_PC_NAME_MAX
_get_volume_info
returns (usually 255); otherwise 12 will be
returned. See section _use_lfn.
_PC_PATH_MAX
_get_volume_info
returns (usually 260); otherwise 80 will be
returned. See section _use_lfn.
_PC_PIPE_BUF
_PC_CHOWN_RESTRICTED
chown
, otherwise anyone may give away files. The DJGPP
version always returns zero, since MS-DOS files can be freely given
away.
_PC_NO_TRUNC
pathconf (filename, _PC_NAME_MAX)
returns are truncated,
otherwise an error occurs if you use longer names. In DJGPP, this
returns 0, since DOS always silently truncates long names.
_PC_VDISABLE
The selected configuration value is returned.
not ANSI, POSIX
char *buf = malloc(pathconf("c:/", _PC_MAX_PATH)+1);
Go to the first, previous, next, last section, table of contents.