Knowledge

stat (system call)

Source 📝

33: 749: 1099: 953:
system calls are executed, or before the file's in-memory inode is evicted from the filesystem cache. Additionally, it is possible to configure for how long atime modifications can remain unflushed. That way, lazytime retains POSIX compatibility while offering performance improvements.
853:("relative atime", introduced in 2.6.20 and the default as of 2.6.30) – only update atime under certain circumstances: if the previous atime is older than the mtime or ctime, or the previous atime is over 24 hours in the past 949:. It allows POSIX-style atime updates to be performed in-memory and flushed to disk together with some non-time-related I/O operations on the same file; atime updates are also flushed to disk when some of the 966:
originally meant creation time; however, while early Unix did have modification and creation times, the latter was changed to be access time before there was any C structure in which to call anything
1077:
In Linux kernels 2.5.48 and above, the stat structure supports nanosecond resolution for the three file timestamp fields. These are exposed as additional fields in the stat structure.
796:
which has been criticized as it is inconsistent with a read only file system. File system cache may significantly reduce this activity to one disk write per cache flush.
817:
mount option offers sufficient performance for most purposes and should not break any significant applications, as it has been extensively discussed. Initially,
821:
only updated atime if atime < mtime or atime < ctime; that was subsequently modified to update atimes that were 24 hours old or older, so that
2280:
Upon successful completion, where nbyte is greater than 0, write() shall mark for update the last data modification and last file status change timestamps
1012:
is affected by renaming a file, despite filenames not being stored in inodes: Both original Unix, which implemented a renaming by making a link (updating
1084:
is 10 milliseconds, while resolution of its write time is two seconds, and access time has a resolution of one day thus it acts as the access date.
565:, since this structure provides a higher resolution time unit. For the sake of compatibility, implementations can define the old names in terms of the 236:
structure, which represents file sizes with a 64-bit type, allowing the functions to work on files 2 GiB and larger (up to 8 EiB). When the
1074:
Some filesystems provide finer granularity. Solaris 2.1 introduced a microsecond resolution with UFS in 1992 and a nanosecond resolution with ZFS.
2439: 920: 759: 174:
buffer argument, which is used to return the file attributes. On success, the functions return zero, and on error, −1 is returned and
2158: 2395: 986:, and has always referred to inode change time. It is updated any time file metadata stored in the inode changes, such as 2368: 2330: 1139: 2209: 2173:"the shell's $ MAIL monitor ... depends on atime, pronouncing new email with atime($ MAIL) < mtime($ MAIL)" 769: 2092: 2360: 17: 2275: 888: 2340: 847:
as of 2.6.30) – always update atime, which conforms to the behavior defined by POSIX
2429: 1117: 1121: 728: 617: 2315: 2170: 2444: 942: 828:
Current versions of the Linux kernel support four mount options, which can be specified in
704:
size for file system I/O, which can depend upon both the system and the type of file system
701: 806:
publicly criticized the concept and performance impact of atime in 2007, and in 2009, the
530:
members; these fields are defined as part of XSI option in the Single Unix Specification.
8: 2392: 1109: 1003: 765: 859: – never update atime of directories, but do update atime of other files 2320:, mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project. 2210:"Linux kernel 4.0, Section 1.5. 'lazytime' option for better update of file timestamps" 813:
option had become the default, which addresses this criticism. The behavior behind the
373:
header file as follows, although implementations are free to define additional fields:
217: 907:, which causes the atime field never to be updated. Turning off atime updating breaks 123: 115: 2364: 127: 2292: 653: 621: 68: 2261: 2060:
A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971–1986
875: – update atime according to specific circumstances laid out below 2409: 2399: 1041: 732: 643: 630: 243:
is defined to 64, these 64-bit functions are available under the original names.
210: 143: 2434: 2058: 1081: 983: 533:
In older versions of POSIX.1 standard, the time-related fields were defined as
56: 2404: 2183: 2097:
The Open Group Base Specifications Issue 6—IEEE Std 1003.1, 2004 Edition
803: 735:. There are many macros to work with the different mode flags and file types. 2423: 194: 32: 2054: 810: 799: 663: 950: 597: 213:
argument instead, and returns attributes of the file that it identifies.
119: 52: 2354: 2134: 982:
timestamp was added in the file system restructuring that occurred with
945:, which was released on April 12, 2015, introduced the new mount option 865: – never update atime of any file or directory; implies 549:. Since the 2008 version of the standard, these fields were renamed to 1049:
is used, or for any other change to the inode other than an update to
81:
uses this system call to retrieve information on files that includes:
995: 724: 673: 634: 155: 131: 2414: 2236: 2146: 2122: 2110: 190: 2346: 2240: 931: 919:" notifications, and some file usage watching utilities, notably 892: 240: 825:
and Debian's popularity counter (popcon) would behave properly.
1067: 896: 86: 710: – number of blocks allocated in multiples of 2171:
http://www.mail-archive.com/mutt-users@mutt.org/msg24912.html
991: 987: 916: 908: 884: 880: 829: 607: 201:
returns attributes of the eventual target of the link, while
175: 151: 60: 2075: 2073: 912: 72: 49: 2070: 77: 2353:
Stevens, W. Richard; Rago, Stephen A. (May 24, 2013).
588:structure includes at least the following members: 970:. The file systems retained just the access time ( 904: 216:The family of functions was extended to implement 2341:IEEE Std 1003.1, 2004, documentation for fstat(2) 2421: 2234: 162:functions, as well as related functions called 2313: 1008:(file modification). In some implementations, 762:to certain ideas, incidents, or controversies 694: – time of last status change 2356:Advanced Programming in the UNIX Environment 1120:. There might be a discussion about this on 1016:) and then unlinking the old name (updating 688: – time of last modification 2352: 2079: 911:compliance, and some applications, such as 869:; highest performance, but least compatible 205:returns attributes of the link itself. The 772:this issue before removing this message. 2149:, LWN, by Jonathan Corbet, March 31, 2009 2125:, LWN, by Jonathan Corbet, August 8, 2007 2066:(Technical report). CSTR. Bell Labs. 139. 1140:Learn how and when to remove this message 1035:cannot be set to an arbitrary value with 1020:again) and modern Linux tend to do this. 1002:(last status change) update with nonzero 662: – device identifier (if 2317:struct stat.h with nanosecond resolution 31: 2053: 14: 2422: 1071:provides times accurate to one second. 682: – time of last access 2235:Jonathan Corbet (November 19, 2014). 738: 2393:An example showing how to use stat() 2111:Linux: Replacing atime With relatime 1092: 1045:utility, for example. Instead, when 742: 170:. The functions take a pointer to a 118:. It is among the few original Unix 2314:Andreas Jaeger (December 2, 2002), 1060: 996:creation and deletion of hard links 766:create a more balanced presentation 137: 103:ctime: time of last status change ( 24: 2262:"BSTJ version of C.ACM Unix paper" 1057:value is set to the current time. 1053:caused by accessing the file, the 96:mtime: time of last modification ( 25: 2456: 2440:Unix file system-related software 2386: 2276:"pwrite, write - write on a file" 2184:"mount(2) - OpenBSD manual pages" 1080:The resolution of create time on 596: – identifier of 364: 1097: 978:) through 6th edition Unix. The 747: 158:operating systems, declares the 2324: 2307: 2285: 2268: 2254: 2228: 2202: 2176: 962:It is tempting to believe that 561:, respectively, of type struct 2164: 2152: 2147:That massive filesystem thread 2140: 2128: 2116: 2103: 2085: 2047: 727:. It combines the file access 616: – protection 246:The functions are defined as: 13: 1: 2293:"stat(2) - Linux manual page" 2041: 700: – preferred 369:This structure is defined in 843:, and formerly the default; 792:eventually requiring a disk 7: 2361:Addison-Wesley Professional 2113:, by Jeremy, August 7, 2007 788:Reading a file changes its 193:argument. If the file is a 10: 2461: 1088: 1304:"Usage: %s: file ... 974:) and modification time ( 714:(usually 512 bytes). 672: – total 518:POSIX.1 does not require 1151: 957: 934:behaves more like Linux 375: 248: 2349:. Retrieved 2012-06-07. 2343:. Retrieved 2012-06-07. 2099:. The Open Group. 2004. 2080:Stevens & Rago 2013 731:and also indicates any 232:return attributes in a 2347:stat(2) Linux man page 2237:"Introducing lazytime" 2137:, Linux Kernel Newbies 1868:/* you may use %lld */ 1562:"getgrgid()" 1493:"getpwuid()" 998:. POSIX also mandates 178:is set appropriately. 40: 2398:May 11, 2017, at the 943:Linux kernel mainline 35: 2093:"<sys/stat.h>" 1110:confusing or unclear 879:Current versions of 63:. The semantics of 2135:Linux kernel 2.6.30 1175:<sys/types.h> 1118:clarify the section 941:Version 4.0 of the 652: – 642: – 629: – 606: – 545:, and were of type 2415:atime and relatime 2359:(Third ed.). 1424:"stat()" 1193:<sys/stat.h> 739:Criticism of atime 577:can be defined as 220:. Functions named 218:large file support 41: 2214:kernelnewbies.org 1150: 1149: 1142: 1039:, as used by the 786: 785: 764:. Please help to 756:This section may 733:special file type 238:_FILE_OFFSET_BITS 209:function takes a 189:functions take a 128:group permissions 71:. As an example, 69:operating systems 16:(Redirected from 2452: 2381: 2379: 2377: 2333: 2331:MSDN: File Times 2328: 2322: 2321: 2311: 2305: 2304: 2302: 2300: 2289: 2283: 2282: 2272: 2266: 2265: 2258: 2252: 2251: 2249: 2247: 2232: 2226: 2225: 2223: 2221: 2206: 2200: 2199: 2197: 2195: 2190:. April 27, 2018 2180: 2174: 2168: 2162: 2161:, Valerie Aurora 2156: 2150: 2144: 2138: 2132: 2126: 2120: 2114: 2107: 2101: 2100: 2089: 2083: 2077: 2068: 2067: 2065: 2051: 2037: 2034: 2031: 2028: 2025: 2022: 2019: 2016: 2013: 2010: 2007: 2004: 2001: 1998: 1995: 1992: 1989: 1986: 1983: 1980: 1977: 1974: 1971: 1968: 1965: 1962: 1959: 1956: 1953: 1950: 1947: 1944: 1941: 1938: 1935: 1932: 1929: 1926: 1923: 1920: 1917: 1914: 1911: 1908: 1905: 1902: 1899: 1896: 1893: 1890: 1887: 1884: 1881: 1878: 1875: 1872: 1869: 1866: 1863: 1860: 1857: 1854: 1851: 1848: 1845: 1842: 1839: 1836: 1833: 1830: 1827: 1824: 1821: 1818: 1815: 1812: 1809: 1806: 1803: 1800: 1797: 1794: 1791: 1788: 1785: 1782: 1779: 1776: 1773: 1770: 1767: 1764: 1761: 1758: 1755: 1752: 1749: 1746: 1743: 1740: 1737: 1734: 1731: 1728: 1725: 1722: 1719: 1716: 1713: 1710: 1707: 1704: 1701: 1698: 1695: 1692: 1689: 1686: 1683: 1680: 1677: 1674: 1671: 1668: 1665: 1662: 1659: 1656: 1653: 1650: 1647: 1644: 1641: 1638: 1635: 1632: 1629: 1626: 1623: 1620: 1617: 1614: 1611: 1608: 1605: 1602: 1599: 1596: 1593: 1590: 1587: 1584: 1581: 1578: 1575: 1572: 1569: 1566: 1563: 1560: 1557: 1554: 1551: 1548: 1545: 1542: 1539: 1536: 1533: 1530: 1527: 1524: 1521: 1518: 1515: 1512: 1509: 1506: 1503: 1500: 1497: 1494: 1491: 1488: 1485: 1482: 1479: 1476: 1473: 1470: 1467: 1464: 1461: 1458: 1455: 1452: 1449: 1446: 1443: 1440: 1437: 1434: 1431: 1428: 1425: 1422: 1419: 1416: 1413: 1410: 1407: 1404: 1401: 1398: 1395: 1392: 1389: 1386: 1383: 1380: 1377: 1374: 1371: 1368: 1365: 1362: 1359: 1356: 1353: 1350: 1347: 1344: 1341: 1338: 1335: 1332: 1329: 1326: 1323: 1320: 1317: 1314: 1311: 1308: 1305: 1302: 1299: 1296: 1293: 1290: 1287: 1284: 1281: 1278: 1275: 1272: 1269: 1266: 1263: 1260: 1257: 1254: 1251: 1248: 1245: 1242: 1239: 1236: 1233: 1230: 1227: 1224: 1221: 1218: 1215: 1212: 1209: 1206: 1203: 1200: 1197: 1194: 1191: 1188: 1185: 1182: 1179: 1176: 1173: 1170: 1167: 1164: 1163:<stdlib.h> 1161: 1158: 1155: 1145: 1138: 1134: 1131: 1125: 1101: 1100: 1093: 1070: 1061:Time granularity 1056: 1052: 1048: 1044: 1038: 1034: 1030: 1026: 1019: 1015: 1011: 1006: 1001: 988:file permissions 981: 977: 973: 969: 965: 948: 937: 929: 903:mount option in 902: 874: 868: 864: 858: 852: 846: 842: 838: 824: 820: 816: 809: 791: 781: 778: 751: 750: 743: 722: 713: 709: 699: 693: 687: 681: 671: 661: 654:group identifier 651: 641: 628: 622:Unix permissions 615: 605: 595: 587: 580: 576: 572: 568: 564: 560: 556: 552: 548: 544: 540: 536: 529: 525: 521: 514: 511: 508: 505: 502: 499: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 439: 436: 433: 430: 427: 424: 421: 418: 415: 412: 409: 406: 403: 400: 397: 394: 391: 388: 385: 382: 379: 372: 360: 357: 354: 351: 348: 345: 342: 339: 336: 333: 330: 327: 324: 321: 318: 315: 312: 309: 306: 303: 300: 297: 294: 291: 288: 285: 282: 279: 276: 273: 270: 267: 264: 261: 258: 255: 252: 239: 235: 231: 227: 223: 208: 204: 200: 188: 184: 173: 169: 165: 161: 149: 138:stat() functions 122:to change, with 113: 106: 99: 92: 89:of last access ( 80: 66: 46: 38: 27:Unix system call 21: 2460: 2459: 2455: 2454: 2453: 2451: 2450: 2449: 2430:C POSIX library 2420: 2419: 2400:Wayback Machine 2389: 2384: 2375: 2373: 2371: 2336: 2329: 2325: 2312: 2308: 2298: 2296: 2291: 2290: 2286: 2274: 2273: 2269: 2260: 2259: 2255: 2245: 2243: 2233: 2229: 2219: 2217: 2208: 2207: 2203: 2193: 2191: 2182: 2181: 2177: 2169: 2165: 2157: 2153: 2145: 2141: 2133: 2129: 2123:Once upon atime 2121: 2117: 2108: 2104: 2091: 2090: 2086: 2078: 2071: 2063: 2052: 2048: 2044: 2039: 2038: 2035: 2032: 2029: 2026: 2023: 2020: 2017: 2014: 2011: 2008: 2005: 2002: 1999: 1996: 1993: 1990: 1987: 1984: 1981: 1978: 1975: 1973:ctime: %s" 1972: 1969: 1966: 1963: 1960: 1957: 1954: 1951: 1948: 1945: 1942: 1939: 1936: 1933: 1930: 1928:mtime: %s" 1927: 1924: 1921: 1918: 1915: 1912: 1909: 1906: 1903: 1900: 1897: 1894: 1891: 1888: 1885: 1883:atime: %s" 1882: 1879: 1876: 1873: 1870: 1867: 1864: 1861: 1858: 1855: 1852: 1849: 1846: 1843: 1840: 1837: 1834: 1831: 1828: 1825: 1822: 1819: 1816: 1813: 1810: 1807: 1804: 1801: 1798: 1795: 1792: 1789: 1786: 1783: 1780: 1777: 1774: 1771: 1768: 1765: 1762: 1759: 1756: 1753: 1750: 1747: 1744: 1741: 1738: 1735: 1732: 1729: 1726: 1723: 1720: 1717: 1714: 1711: 1708: 1705: 1702: 1699: 1696: 1693: 1690: 1687: 1684: 1681: 1678: 1675: 1672: 1669: 1666: 1663: 1660: 1657: 1654: 1651: 1648: 1645: 1642: 1639: 1636: 1633: 1630: 1627: 1624: 1621: 1618: 1615: 1612: 1609: 1606: 1603: 1600: 1597: 1594: 1591: 1588: 1585: 1582: 1579: 1576: 1573: 1570: 1567: 1564: 1561: 1558: 1555: 1552: 1549: 1546: 1543: 1540: 1537: 1534: 1531: 1528: 1525: 1522: 1519: 1516: 1513: 1510: 1507: 1504: 1501: 1498: 1495: 1492: 1489: 1486: 1483: 1480: 1477: 1474: 1471: 1468: 1465: 1462: 1459: 1456: 1453: 1450: 1447: 1444: 1441: 1438: 1435: 1432: 1429: 1426: 1423: 1420: 1417: 1414: 1411: 1408: 1405: 1402: 1399: 1396: 1393: 1390: 1387: 1384: 1381: 1378: 1375: 1372: 1369: 1366: 1363: 1360: 1357: 1354: 1351: 1348: 1345: 1342: 1339: 1336: 1333: 1330: 1327: 1324: 1321: 1318: 1315: 1312: 1309: 1306: 1303: 1300: 1297: 1294: 1291: 1288: 1285: 1282: 1279: 1276: 1273: 1270: 1267: 1264: 1261: 1258: 1255: 1252: 1249: 1246: 1243: 1240: 1237: 1234: 1231: 1228: 1225: 1222: 1219: 1216: 1213: 1210: 1207: 1204: 1201: 1198: 1195: 1192: 1189: 1186: 1183: 1180: 1177: 1174: 1171: 1168: 1165: 1162: 1159: 1157:<stdio.h> 1156: 1153: 1146: 1135: 1129: 1126: 1115: 1102: 1098: 1091: 1066: 1063: 1054: 1050: 1046: 1040: 1036: 1032: 1028: 1024: 1017: 1013: 1009: 1004: 999: 979: 975: 971: 967: 963: 960: 946: 935: 927: 900: 872: 866: 862: 856: 850: 844: 840: 836: 822: 818: 814: 807: 789: 782: 776: 773: 752: 748: 741: 720: 717: 711: 707: 697: 691: 685: 679: 669: 659: 649: 644:user identifier 639: 631:reference count 626: 613: 603: 600:containing file 593: 585: 578: 574: 573:. For example, 571:struct timespec 570: 566: 562: 558: 554: 550: 546: 542: 538: 534: 527: 523: 519: 516: 515: 512: 509: 506: 503: 500: 497: 494: 491: 488: 485: 482: 479: 476: 473: 470: 467: 464: 461: 458: 455: 452: 449: 446: 443: 440: 437: 434: 431: 428: 425: 422: 419: 416: 413: 410: 407: 404: 401: 398: 395: 392: 389: 386: 383: 380: 377: 370: 367: 362: 361: 358: 355: 352: 349: 346: 343: 340: 337: 334: 331: 328: 325: 322: 319: 316: 313: 310: 307: 304: 301: 298: 295: 292: 289: 286: 283: 280: 277: 274: 271: 268: 265: 262: 259: 256: 253: 250: 237: 233: 229: 225: 221: 211:file descriptor 206: 202: 198: 186: 182: 171: 167: 163: 159: 147: 144:C POSIX library 140: 126:'s addition of 111: 104: 97: 90: 76: 64: 57:file attributes 44: 36: 28: 23: 22: 15: 12: 11: 5: 2458: 2448: 2447: 2442: 2437: 2432: 2418: 2417: 2412: 2407: 2405:stat() in Perl 2402: 2388: 2387:External links 2385: 2383: 2382: 2370:978-0321637734 2369: 2350: 2344: 2337: 2335: 2334: 2323: 2306: 2284: 2267: 2253: 2227: 2201: 2175: 2163: 2159:Relatime Recap 2151: 2139: 2127: 2115: 2102: 2084: 2069: 2055:McIlroy, M. D. 2045: 2043: 2040: 1703:group: %u (%s) 1655:owner: %u (%s) 1169:<time.h> 1152: 1148: 1147: 1105: 1103: 1096: 1090: 1087: 1086: 1085: 1082:FAT filesystem 1078: 1075: 1072: 1062: 1059: 992:file ownership 984:Version 7 Unix 959: 956: 877: 876: 870: 860: 854: 848: 784: 783: 768:. Discuss and 755: 753: 746: 740: 737: 716: 715: 705: 695: 689: 683: 677: 667: 657: 647: 637: 624: 611: 601: 590: 579:st_atim.tv_sec 376: 366: 365:stat structure 363: 249: 139: 136: 116:Version 1 Unix 109: 108: 101: 94: 26: 9: 6: 4: 3: 2: 2457: 2446: 2443: 2441: 2438: 2436: 2433: 2431: 2428: 2427: 2425: 2416: 2413: 2411: 2410:stat() in PHP 2408: 2406: 2403: 2401: 2397: 2394: 2391: 2390: 2372: 2366: 2362: 2358: 2357: 2351: 2348: 2345: 2342: 2339: 2338: 2332: 2327: 2319: 2318: 2310: 2294: 2288: 2281: 2277: 2271: 2263: 2257: 2242: 2238: 2231: 2216:. May 1, 2015 2215: 2211: 2205: 2194:September 26, 2189: 2185: 2179: 2172: 2167: 2160: 2155: 2148: 2143: 2136: 2131: 2124: 2119: 2112: 2109:Kernel Trap: 2106: 2098: 2094: 2088: 2082:, p. 94. 2081: 2076: 2074: 2062: 2061: 2056: 2050: 2046: 1187:<grp.h> 1181:<pwd.h> 1144: 1141: 1133: 1123: 1122:the talk page 1119: 1113: 1111: 1106:This section 1104: 1095: 1094: 1083: 1079: 1076: 1073: 1069: 1065: 1064: 1058: 1043: 1021: 1007: 997: 993: 989: 985: 955: 952: 944: 939: 933: 924: 922: 918: 915:-driven "new 914: 910: 906: 898: 894: 890: 886: 882: 871: 861: 855: 849: 835: 834: 833: 831: 826: 812: 805: 801: 797: 795: 780: 771: 767: 763: 761: 754: 745: 744: 736: 734: 730: 726: 706: 703: 696: 690: 684: 678: 675: 668: 665: 658: 655: 648: 645: 638: 636: 632: 625: 623: 619: 612: 609: 602: 599: 592: 591: 589: 582: 531: 374: 247: 244: 242: 234:struct stat64 219: 214: 212: 196: 195:symbolic link 192: 179: 177: 157: 153: 145: 135: 133: 129: 125: 121: 117: 102: 95: 88: 84: 83: 82: 79: 74: 70: 67:vary between 62: 58: 55:that returns 54: 51: 47: 34: 30: 19: 2445:System calls 2376:February 27, 2374:. Retrieved 2355: 2326: 2316: 2309: 2299:February 27, 2297:. Retrieved 2287: 2279: 2270: 2256: 2244:. Retrieved 2230: 2218:. Retrieved 2213: 2204: 2192:. Retrieved 2187: 2178: 2166: 2154: 2142: 2130: 2118: 2105: 2096: 2087: 2059: 2049: 1574:EXIT_FAILURE 1505:EXIT_FAILURE 1436:EXIT_FAILURE 1328:EXIT_FAILURE 1136: 1130:January 2023 1127: 1116:Please help 1107: 1022: 961: 940: 925: 878: 827: 800:Linux kernel 798: 793: 787: 774: 760:undue weight 757: 718: 664:special file 583: 532: 517: 368: 245: 215: 180: 141: 120:system calls 114:appeared in 110: 43: 42: 39:command line 29: 2188:openbsd.org 845:strictatime 837:strictatime 804:Ingo Molnár 723:field is a 620:; see also 586:struct stat 172:struct stat 150:, found on 130:and larger 53:system call 18:Stat (Unix) 2424:Categories 2295:. man7.org 2042:References 1112:to readers 930:option on 905:/etc/fstab 899:support a 867:nodiratime 857:nodiratime 839:(formerly 802:developer 777:March 2015 698:st_blksize 676:, in bytes 635:hard links 569:member of 528:st_blksize 498:st_blksize 371:sys/stat.h 154:and other 148:sys/stat.h 1844:size: %ld 1808:links: %d 1751:perms: %o 1619:inode: %u 1589:"%s: 725:bit field 712:DEV_BSIZE 708:st_blocks 674:file size 524:st_blocks 507:st_blocks 495:blksize_t 230:fstat64() 226:lstat64() 156:Unix-like 132:file size 124:Version 4 59:about an 2396:Archived 2057:(1987). 1826:st_nlink 1535:getgrgid 1466:getpwuid 1190:#include 1184:#include 1178:#include 1172:#include 1166:#include 1160:#include 1154:#include 947:lazytime 936:relatime 921:tmpwatch 873:lazytime 851:relatime 823:tmpwatch 819:relatime 815:relatime 808:relatime 692:st_ctime 686:st_mtime 680:st_atime 656:of owner 646:of owner 627:st_nlink 575:st_atime 563:timespec 543:st_ctime 539:st_mtime 535:st_atime 504:blkcnt_t 486:timespec 474:timespec 462:timespec 426:st_nlink 341:filedesc 308:filename 269:filename 222:stat64() 191:filename 75:command 2241:LWN.net 1994:st_ctim 1949:st_mtim 1904:st_atim 1862:st_size 1790:S_IRWXO 1784:S_IRWXG 1778:S_IRWXU 1769:st_mode 1733:gr_name 1685:pw_name 1292:fprintf 1108:may be 1089:Example 1047:utime() 1037:utime() 1023:Unlike 1005:write() 932:OpenBSD 928:noatime 901:noatime 893:FreeBSD 889:Solaris 863:noatime 770:resolve 721:st_mode 670:st_size 660:st_rdev 614:st_mode 559:st_ctim 555:st_mtim 551:st_atim 520:st_rdev 489:st_ctim 477:st_mtim 465:st_atim 453:st_size 423:nlink_t 417:st_rdev 390:st_mode 207:fstat() 203:lstat() 187:lstat() 168:lstat() 164:fstat() 146:header 85:atime: 2367:  2246:May 2, 2220:May 2, 2027:return 2018:" 2012:" 2006:printf 2000:tv_sec 1967:" 1961:printf 1955:tv_sec 1922:" 1916:printf 1910:tv_sec 1877:" 1871:printf 1850:" 1838:" 1832:printf 1814:" 1802:" 1796:printf 1757:" 1745:" 1739:printf 1727:grpnam 1721:st_gid 1709:" 1697:" 1691:printf 1679:pwuser 1673:st_uid 1661:" 1649:" 1643:printf 1637:st_ino 1625:" 1613:" 1607:printf 1595:" 1583:printf 1556:perror 1547:st_gid 1529:grpnam 1487:perror 1478:st_uid 1460:pwuser 1418:perror 1310:" 1298:stderr 1265:grpnam 1256:struct 1250:pwuser 1244:passwd 1241:struct 1229:struct 1068:time_t 994:, and 897:NetBSD 895:, and 794:write, 650:st_gid 640:st_uid 610:number 604:st_ino 598:device 594:st_dev 567:tv_sec 547:time_t 483:struct 471:struct 459:struct 444:st_gid 435:st_uid 408:st_dev 399:st_ino 387:mode_t 378:struct 347:struct 314:struct 275:struct 199:stat() 183:stat() 160:stat() 105:ls -lc 91:ls -lu 65:stat() 45:stat() 2435:POSIX 2064:(PDF) 1985:& 1979:ctime 1940:& 1934:ctime 1895:& 1889:ctime 1772:& 1730:-> 1682:-> 1406:& 1259:group 1055:ctime 1051:atime 1042:touch 1033:ctime 1029:mtime 1025:atime 1018:ctime 1014:ctime 1010:ctime 1000:ctime 980:ctime 976:mtime 972:atime 968:ctime 964:ctime 958:ctime 909:POSIX 885:macOS 881:Linux 841:atime 830:fstab 811:mount 790:atime 758:lend 729:modes 702:block 608:inode 450:off_t 441:gid_t 432:uid_t 414:dev_t 405:dev_t 396:ino_t 332:fstat 299:const 293:lstat 260:const 241:macro 176:errno 152:POSIX 98:ls -l 61:inode 48:is a 2378:2015 2365:ISBN 2301:2015 2248:2015 2222:2015 2196:2018 1601:argv 1568:exit 1520:NULL 1499:exit 1451:NULL 1430:exit 1400:argv 1394:stat 1364:argc 1361:< 1322:exit 1316:argv 1280:< 1277:argc 1232:stat 1220:argv 1214:char 1208:argc 1199:main 1027:and 951:sync 926:The 917:mail 913:mbox 719:The 618:mode 584:The 557:and 541:and 526:and 381:stat 350:stat 317:stat 302:char 278:stat 263:char 254:stat 228:and 185:and 181:The 166:and 142:The 112:stat 87:time 73:Unix 50:Unix 37:stat 2003:)); 1958:)); 1913:)); 1793:)); 1550:))) 1481:))) 1343:int 1337:for 1205:int 1196:int 633:of 356:buf 338:int 329:int 323:buf 290:int 284:buf 251:int 2426:: 2363:. 2278:. 2239:. 2212:. 2186:. 2095:. 2072:^ 2021:); 2015:\n 1988:sb 1970:\t 1943:sb 1925:\t 1898:sb 1880:\t 1865:); 1856:sb 1847:\n 1841:\t 1829:); 1820:sb 1811:\n 1805:\t 1763:sb 1754:\n 1748:\t 1736:); 1715:sb 1706:\n 1700:\t 1688:); 1667:sb 1658:\n 1652:\t 1640:); 1631:sb 1622:\n 1616:\t 1604:); 1592:\n 1577:); 1565:); 1541:sb 1523:== 1514:if 1508:); 1496:); 1472:sb 1454:== 1445:if 1439:); 1427:); 1412:)) 1409:sb 1391:== 1388:-1 1382:if 1373:++ 1331:); 1319:); 1307:\n 1271:if 1235:sb 1031:, 990:, 938:. 923:. 891:, 887:, 883:, 832:: 581:. 553:, 537:, 522:, 513:}; 359:); 326:); 287:); 224:, 197:, 134:. 78:ls 2380:. 2303:. 2264:. 2250:. 2224:. 2198:. 2036:} 2033:; 2030:0 2024:} 2009:( 1997:. 1991:. 1982:( 1976:, 1964:( 1952:. 1946:. 1937:( 1931:, 1919:( 1907:. 1901:. 1892:( 1886:, 1874:( 1859:. 1853:, 1835:( 1823:. 1817:, 1799:( 1787:| 1781:| 1775:( 1766:. 1760:, 1742:( 1724:, 1718:. 1712:, 1694:( 1676:, 1670:. 1664:, 1646:( 1634:. 1628:, 1610:( 1598:, 1586:( 1580:} 1571:( 1559:( 1553:{ 1544:. 1538:( 1532:= 1526:( 1517:( 1511:} 1502:( 1490:( 1484:{ 1475:. 1469:( 1463:= 1457:( 1448:( 1442:} 1433:( 1421:( 1415:{ 1403:, 1397:( 1385:( 1379:{ 1376:) 1370:i 1367:; 1358:i 1355:; 1352:1 1349:= 1346:i 1340:( 1334:} 1325:( 1313:, 1301:, 1295:( 1289:{ 1286:) 1283:2 1274:( 1268:; 1262:* 1253:; 1247:* 1238:; 1226:{ 1223:) 1217:* 1211:, 1202:( 1143:) 1137:( 1132:) 1128:( 1124:. 1114:. 779:) 775:( 666:) 510:; 501:; 492:; 480:; 468:; 456:; 447:; 438:; 429:; 420:; 411:; 402:; 393:; 384:{ 353:* 344:, 335:( 320:* 311:, 305:* 296:( 281:* 272:, 266:* 257:( 107:) 100:) 93:) 20:)

Index

Stat (Unix)

Unix
system call
file attributes
inode
operating systems
Unix
ls
time
Version 1 Unix
system calls
Version 4
group permissions
file size
C POSIX library
POSIX
Unix-like
errno
filename
symbolic link
file descriptor
large file support
macro
device
inode
mode
Unix permissions
reference count
hard links

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.