Lines Matching defs:pathname
596 assertion_chdir(const char *file, int line, const char *pathname)
599 if (chdir(pathname) == 0)
601 failure_start(file, line, "chdir(\"%s\")", pathname);
609 assertion_chmod(const char *file, int line, const char *pathname, int mode)
612 if (chmod(pathname, mode) == 0)
614 failure_start(file, line, "chmod(\"%s\", %4.o)", pathname, mode);
1222 const char *pathname, const char *lines[])
1234 buff = slurpfile(&buff_size, "%s", pathname);
1236 failure_start(pathname, line, "Can't read file: %s", pathname);
1249 failure_start(pathname, line, "Can't allocate memory");
1256 failure_start(pathname, line, "Can't allocate memory");
1275 failure_start(pathname, line, "Can't allocate memory");
1317 failure_start(file, line, "File doesn't match: %s", pathname);
1345 const char *pathname, const char *strings[])
1350 buff = slurpfile(NULL, "%s", pathname);
1352 failure_start(file, line, "Can't read file: %s", pathname);
1359 failure_start(file, line, "Invalid string in %s: %s", pathname,
1442 /* Verify a/b/mtime of 'pathname'. */
1446 const char *pathname, long t, long nsec, char type, int recent)
1462 * the pathname is a directory. */
1463 h = CreateFileA(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
1466 failure_start(file, line, "Can't access %s\n", pathname);
1478 failure_start(file, line, "Can't GetFileTime %s\n", pathname);
1491 r = lstat(pathname, &st);
1493 failure_start(file, line, "Can't stat %s\n", pathname);
1535 pathname, type, filet, now - filet);
1542 pathname, type, filet, filet_nsec, t, nsec);
1549 /* Verify atime of 'pathname'. */
1552 const char *pathname, long t, long nsec)
1554 return assertion_file_time(file, line, pathname, t, nsec, 'a', 0);
1557 /* Verify atime of 'pathname' is up-to-date. */
1559 assertion_file_atime_recent(const char *file, int line, const char *pathname)
1561 return assertion_file_time(file, line, pathname, 0, 0, 'a', 1);
1564 /* Verify birthtime of 'pathname'. */
1567 const char *pathname, long t, long nsec)
1569 return assertion_file_time(file, line, pathname, t, nsec, 'b', 0);
1572 /* Verify birthtime of 'pathname' is up-to-date. */
1575 const char *pathname)
1577 return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
1580 /* Verify mode of 'pathname'. */
1582 assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode)
1592 (void)pathname; /* UNUSED */
1597 r = lstat(pathname, &st);
1603 pathname, mode, expected_mode);
1609 /* Verify mtime of 'pathname'. */
1612 const char *pathname, long t, long nsec)
1614 return assertion_file_time(file, line, pathname, t, nsec, 'm', 0);
1617 /* Verify mtime of 'pathname' is up-to-date. */
1619 assertion_file_mtime_recent(const char *file, int line, const char *pathname)
1621 return assertion_file_time(file, line, pathname, 0, 0, 'm', 1);
1624 /* Verify number of links to 'pathname'. */
1627 const char *pathname, int nlinks)
1634 r = my_GetFileInformationByName(pathname, &bhfi);
1638 pathname, (intmax_t)bhfi.nNumberOfLinks, nlinks);
1646 r = lstat(pathname, &st);
1650 pathname, (intmax_t)st.st_nlink, nlinks);
1656 /* Verify size of 'pathname'. */
1658 assertion_file_size(const char *file, int line, const char *pathname, long size)
1667 r = !my_GetFileInformationByName(pathname, &bhfi);
1673 r = lstat(pathname, &st);
1680 pathname, (long)filesize, (long)size);
1685 /* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */
1687 assertion_is_dir(const char *file, int line, const char *pathname, int mode)
1696 r = lstat(pathname, &st);
1698 failure_start(file, line, "Dir should exist: %s", pathname);
1703 failure_start(file, line, "%s is not a dir", pathname);
1712 failure_start(file, line, "Dir %s has wrong mode", pathname);
1722 /* Verify that 'pathname' is a regular file. If 'mode' is >= 0,
1725 assertion_is_reg(const char *file, int line, const char *pathname, int mode)
1734 r = lstat(pathname, &st);
1736 failure_start(file, line, "File should exist: %s", pathname);
1745 failure_start(file, line, "File %s has wrong mode", pathname);
1756 * Check whether 'pathname' is a symbolic link. If 'contents' is
1765 const char *pathname, const char *contents, int isdir)
1781 /* Replace slashes with backslashes in pathname */
1782 pn = malloc(strlen(pathname) + 1);
1788 for (p = pathname, s = pn; *p != '\0'; p++, s++) {
1800 failure_start(file, line, "Can't access %s\n", pathname);
1807 "Can't stat: %s", pathname);
1811 "Not a symlink: %s", pathname);
1817 "Not a directory symlink: %s", pathname);
1824 "Not a file symlink: %s", pathname);
1840 "Could not retrieve symlink target: %s", pathname);
1850 "Not a symlink: %s", pathname);
1897 r = lstat(pathname, &st);
1900 "Symlink should exist: %s", pathname);
1908 linklen = readlink(pathname, buff, sizeof(buff) - 1);
1910 failure_start(file, line, "Can't read symlink %s", pathname);
2100 assertion_utimes(const char *file, int line, const char *pathname,
2114 h = CreateFileA(pathname,GENERIC_READ | GENERIC_WRITE,
2118 failure_start(file, line, "Can't access %s\n", pathname);
2143 failure_start(file, line, "Can't SetFileTime %s\n", pathname);
2158 r = lstat(pathname, &st);
2160 failure_start(file, line, "Can't stat %s\n", pathname);
2189 r = lutimes(pathname, times);
2191 r = utimes(pathname, times);
2194 failure_start(file, line, "Can't utimes %s\n", pathname);
2298 assertion_set_nodump(const char *file, int line, const char *pathname)
2304 r = chflags(pathname, UF_NODUMP);
2306 failure_start(file, line, "Can't set nodump %s\n", pathname);
2317 fd = open(pathname, O_RDONLY | O_NONBLOCK);
2319 failure_start(file, line, "Can't open %s\n", pathname);
2331 failure_start(file, line, "Can't get flags %s\n", pathname);
2349 failure_start(file, line, "Can't set nodump %s\n", pathname);
2355 (void)pathname; /* UNUSED */
4153 "ERROR: Temp directory pathname too long\n");