Lines Matching +defs:file +defs:name +defs:directory
3 ** This file is in the public domain, so clarified as of
57 # define mkdir(name, mode) _mkdir(name)
166 readlink(char const *restrict file, char *restrict buf, size_t size)
584 /* In most of the code, an input file name is represented by its index
589 /* Return the name of the Ith input file, for diagnostics. */
658 close_file(FILE *stream, char const *dir, char const *name,
666 name ? name : "", name ? ": " : "",
679 "\t[ -b {slim|fat} ] [ -d directory ] [ -l localtime ]"
691 /* Change the working directory to DIR, possibly creating DIR and its
711 /* Compare the two links A and B, for a stable sort by link name. */
722 file numbers (where subtraction cannot overflow) and possibly
746 /* Ignore each link superseded by a later link with the same name. */
900 /* The minimum and maximum values representable in a TZif file. */
962 static const char * directory;
965 /* -1 if the TZif output file should be slim, 0 if default, 1 if the
1030 if (directory == NULL)
1031 directory = optarg;
1133 if (directory == NULL)
1134 directory = TZDIR;
1148 change_directory(directory);
1173 componentcheck(char const *name, char const *component,
1179 if (!*name)
1180 error(_("empty file name"));
1182 error(_(component == name
1183 ? "file name '%s' begins with '/'"
1185 ? "file name '%s' contains '//'"
1186 : "file name '%s' ends with '/'"),
1187 name);
1193 error(_("file name '%s' contains '%.*s' component"),
1194 name, len, component);
1199 warning(_("file name '%s' component contains leading '-'"),
1200 name);
1202 warning(_("file name '%s' contains overlength component"
1204 name, component_len_max, component);
1210 namecheck(const char *name)
1214 /* Benign characters in a portable file name. */
1225 register char const *component = name;
1226 for (cp = name; *cp; cp++) {
1230 ? _("file name '%s' contains byte '%c'")
1231 : _("file name '%s' contains byte '\\%o'")),
1232 name, c);
1235 if (!componentcheck(name, component, cp))
1240 return componentcheck(name, component, cp);
1299 /* Generate a randomish name in the same directory as *NAME. If
1300 *NAMEALLOC, put the name into *NAMEALLOC which is assumed to be
1302 and equal to *NAME; otherwise, allocate a new name and put its
1305 random_dirent(char const **name, char **namealloc)
1307 char const *src = *name;
1337 *name = *namealloc = dst;
1350 /* Prepare to write to the file *OUTNAME, using *TEMPNAME to store the
1351 name of the temporary file that will eventually be renamed to
1352 *OUTNAME. Assign the temporary file's name to both *OUTNAME and
1353 *TEMPNAME. If *TEMPNAME is null, allocate the name of any such
1354 temporary file; otherwise, reuse *TEMPNAME's storage, which is
1379 progname, directory, *outname, strerror(fopen_errno));
1387 /* If TEMPNAME, the result is in the temporary file TEMPNAME even
1391 rename_dest(char *tempname, char const *name)
1394 if (rename(tempname, name) != 0) {
1398 progname, directory, name, strerror(rename_errno));
1406 freshly allocated string. TARGET should be a relative file name, and
1418 size_t len = strlen(directory);
1419 size_t lenslash = len + (len && directory[len - 1] != '/');
1423 memcpy(result, directory, len);
1446 Keep it simple, and do not inspect the file system. */
1473 progname, directory, linkname, e);
1491 and A and B might not have the same parent directory.
1517 progname, directory, target, directory, outname,
1554 progname, directory, target, e);
1560 close_file(tp, directory, linkname, tempname);
1561 close_file(fp, directory, target, NULL);
1577 itssymlink(char const *name, int *cache)
1581 *cache = readlink(name, &c, 1) < 0 ? 0 : c == '/' ? 1 : -1;
1591 ** Sort by rule name.
1617 warning(_("same rule name in multiple files"));
1619 warning(_("same rule name in multiple files"));
1706 infile(int fnum, char const *name)
1713 if (strcmp(name, "-") == 0) {
1715 } else if ((fp = fopen(name, "r")) == NULL) {
1719 progname, name, e);
1868 error(_("Invalid rule name \"%s\""), fields[RF_NAME]);
1908 error(_("duplicate zone name %s"
1909 " (file \"%s\", line %"PRIdMAX")"),
2059 error(_("invalid month name"));
2164 error(_("invalid month name"));
2271 error(_("invalid weekday name"));
2391 writezone(const char *const name, const char *const string, char version,
2398 char const *outname = name;
2496 name);
2504 name);
2794 close_file(fp, directory, name, tempname);
2795 rename_dest(tempname, name);
3937 Do not consider an existing file to be trouble. */
3941 char *name = xstrdup(argname);
3942 char *cp = name;
3947 option of zic does not name an already-existing directory,
3951 /* Do not mkdir a root directory, as it must exist. */
3960 ** the directory already exists, perhaps because some
3965 if (mkdir(name, MKDIR_UMASK) != 0) {
3967 some other process might have made the directory
3970 directory is an automounted mount point.
3972 with EACCES merely because the parent directory
3978 error(_("%s: Can't create directory %s: %s"),
3979 progname, name, strerror(err));
3986 free(name);