Lines Matching defs:file

1 /* pathchk -- check whether file names are valid or portable
67 # define pathconf(file, flag) \
99 Diagnose invalid or unportable file names.\n\
171 no_leading_hyphen (char const *file)
175 for (p = file; (p = strchr (p, '-')); p++)
176 if (p == file || p[-1] == '/')
178 error (0, 0, _("leading `-' in a component of file name %s"),
179 quote (file));
190 portable_chars_only (char const *file, size_t filelen)
192 size_t validlen = strspn (file,
197 char const *invalid = file + validlen;
204 _("nonportable character %s in file name %s"),
207 quote_n (0, file));
214 /* Return the address of the start of the next file name component in F. */
224 /* Return the size of the file name component F. F must be nonempty. */
247 If CHECK_EXTRA_PORTABILITY is true, check that file name components do not
251 check that the file name is not empty.
256 validate_file_name (char *file, bool check_basic_portability,
259 size_t filelen = strlen (file);
261 /* Start of file name component being checked. */
267 /* True if the file is known to exist. */
270 if (check_extra_portability && ! no_leading_hyphen (file))
280 error (0, 0, _("empty file name"));
286 if (! portable_chars_only (file, filelen))
291 /* Check whether a file name component is in a directory that
293 POSIX does not allow "" as a file name, but some non-POSIX
297 if (lstat (file, &st) == 0)
301 error (0, errno, "%s", file);
316 char const *dir = (*file == '/' ? "/" : ".");
322 _("%s: unable to determine maximum file name length"),
333 error (0, 0, _("limit %lu exceeded by length %lu of file name %s"),
334 maxlen, len, quote (file));
340 whether all file name components are so short that they are valid
341 in any file system on this platform. If CHECK_BASIC_PORTABILITY, though,
347 for (start = file; *(start = component_start (start)); )
363 /* The limit on file name components for the current component.
369 /* If nonzero, the known limit on file name components. */
372 for (start = file; *(start = component_start (start)); )
381 char const *dir = (start == file ? "." : file);
420 "of file name component %s"),