/usr/share/GNUstep/Documentation/Developer/Base/Reference/NSFileManager.html is in gnustep-base-doc 1.24.7-1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>NSFileManager class reference</title>
</head>
<body>
<font face="serif">
<a href="Base.html">Up</a>
<br />
<h1><a name="title$NSFileManager">NSFileManager class reference</a></h1>
<h3>Authors</h3>
<dl>
<dt>Mircea Oancea (<a href="mailto:mircea@jupiter.elcom.pub.ro"><code>mircea@jupiter.elcom.pub.ro</code></a>)</dt>
<dd>
</dd>
<dt>Ovidiu Predescu (<a href="mailto:ovidiu@net-community.com"><code>ovidiu@net-community.com</code></a>)</dt>
<dd>
</dd>
<dt>Nicola Pero (<a href="mailto:n.pero@mi.flashnet.it"><code>n.pero@mi.flashnet.it</code></a>)</dt>
<dd>
</dd>
<dt>Richard Frith-Macdonald (<a href="mailto:rfm@gnu.org"><code>rfm@gnu.org</code></a>)</dt>
<dd>
</dd>
</dl>
<p><b>Version:</b> 38010</p>
<p><b>Date:</b> 2014-07-25 11:38:20 +0100 (Fri, 25 Jul 2014)</p>
<p><b>Copyright:</b> (C) 1997,1999-2005 Free Software Foundation, Inc.</p>
<div>
<hr width="50%" align="left" />
<h3>Contents -</h3>
<ol>
<li>
<a href="#001000000000">File management</a>
</li>
<li>
<a href="#001001000000">Path handling</a>
<li>
<a href="#001001001000">unix</a>
<ol>
<li>
<a href="#001001002000">windows</a>
</li>
<li>
<a href="#001001003000">gnustep</a>
</li>
<li>
<a href="#001001004000">Portability</a>
</li>
<li>
<a href="#001001005000">Tilde substitution</a>
</li>
</ol>
</li>
</ol>
</li>
<li>
<a href="#002000000000">Software documentation for the NSDirectoryEnumerator
class</a>
</li>
<li>
<a href="#003000000000">Software documentation for the NSFileManager class</a>
</li>
<li>
<a href="#004000000000">Software documentation for the
NSDictionary(NSFileAttributes)
category</a>
</li>
<li>
<a href="#005000000000">Software documentation for the
NSObject(NSFileManagerHandler)
informal protocol</a>
</li>
</ol>
<hr width="50%" align="left" />
</div>
<h1><a name="001000000000">File management</a></h1>
<h2><a name="001001000000">Path handling</a></h2>
<p>
The rules for path handling depend on the value in the
<code>GNUSTEP_PATH_HANDLING</code> environment
variable and, to some extent, on the platform on
which the program is running. <br /> The understood
values of GNUSTEP_PATH_HANDLING are <em>unix</em> and
<em>windows</em>. If GNUSTEP_PATH_HANDLING is any other
value (or has not been set), GNUstep interprets this as
meaning it should try to <em>do-the-right-thing</em>
<br /> In the default mode of operation the system is
very tolerant of paths and allows you to work with both
unix and windows style paths. The consequences of this
are apparent in the path handling methods of
<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>
rather than in
<a rel="gsdoc" href="#class$NSFileManager">NSFileManager</a>
.
</p>
<h3><a name="001001001000">unix</a></h3>
<p>
On all Unix platforms, Path components are separated
by slashes and file names may contain any character
other than slash. <br /> The file names. and..
are special cases meaning current directory and the
parent of the current directory respectively.
<br /> Multiple adjacent slash characters are
treated as a single separator.
</p>
<dl>
<dt>/</dt>
<dd>
An absolute path to the root directory.
</dd>
<dt>/etc/motd</dt>
<dd>
An absolute path to the file named <em>motd</em>
in the subdirectory <em>etc</em> of the root
directory.
</dd>
<dt>..</dt>
<dd>
A relative path to the parent of the current
directory.
</dd>
<dt>program.m</dt>
<dd>
A relative path to the file <em>program.m</em> in
the current directory.
</dd>
<dt>Source/program.m</dt>
<dd>
A relative path to the file <em>program.m</em> in
the subdirectory <em>Source</em> of the current
directory.
</dd>
<dt>../GNUmakefile</dt>
<dd>
A relative path to the file <em>GNUmakefile</em> in
the directory above the current directory.
</dd>
</dl>
<h3><a name="001001002000">windows</a></h3>
<p>
On Microsoft Windows the native paths may be either
UNC or drive-relative, so GNUstep supports both.
<br /> Either or both slash (/) and backslash
(\) may be used as separators for path components
in either type of name. <br /> UNC paths follow the
general form //host/share/path/file, but must
at least contain the host and share parts, i.e.
//host/share is a UNC path, but //host is
<em>not</em> <br /> Drive-relative names consist
of an optional drive specifier (consisting of a
single letter followed by a single colon)
followed by an absolute or relative path.
<br /> In both forms, the names. and.. are refer
to the current directory and the parent directory as
in unix paths.
</p>
<dl>
<dt>//host/share/file</dt>
<dd>
An absolute UNC path to a file called
<em>file</em> in the top directory of the export
point share on host.
</dd>
<dt>C:</dt>
<dd>
A relative path to the current directory on drive
C.
</dd>
<dt>C:program.m</dt>
<dd>
A relative path to the file <em>program.m</em> on
drive C.
</dd>
<dt>C:\program.m</dt>
<dd>
An absolute path to the file <em>program.m</em> in
the top level directory on drive C.
</dd>
<dt>/Source\program.m</dt>
<dd>
A drive-relative path to <em>program.m</em> in the
directory <em>Source</em> on the current
drive.
</dd>
<dt>\\name</dt>
<dd>
A drive-relative path to <em>name</em> in the top
level directory on the current drive. The '\\'
is treated as a single backslash as this is not a
UNC name (there must be both a host and a share
part in a UNC name).
</dd>
</dl>
<h3><a name="001001003000">gnustep</a></h3>
<p>
In the default mode, GNUstep handles both unix and
windows paths so it treats both slash (/) and
backslash (\) as separators and understands
the windows UNC and drive relative path roots.
<br /> However, it treats any path beginning
with a slash (/) as an absolute path
<em>if running on a unix system</em>.
</p>
<h3><a name="001001004000">Portability</a></h3>
<p>
Attempting to pass absolute paths between
applications working on different systems
is fraught with difficulty... just don't do it.
<br /> Where paths need to be passed around (eg.
in property lists or archives) you should pass
relative paths and use a standard mechanism to
construct an absolute path in the receiving
application, for instance, appending the
relative path to the home directory of a user.
</p>
<ul>
<li>
Use only the slash (/) as a path separator, not
backslash (\).
</li>
<li>
Never use a backslash (\) in a file name.
</li>
<li>
Avoid colons in file names.
</li>
<li>
Use no more than three letters in a path
extension.
</li>
</ul>
<h3><a name="001001005000">Tilde substitution</a></h3>
<p>
GNUstep handles substitution of tilde (~) as
follows: <br /> If a path is just ~ or begins
~/ then the value returned by
<a rel="gsdoc" href="Functions.html#function$NSHomeDirectory">
NSHomeDirectory()
</a>
is substituted for the tilde. <br /> If a path is of
the form ~name or begins with a string like ~name/
then name is used as the argument to
<a rel="gsdoc" href="Functions.html#function$NSHomeDirectoryForUser">
NSHomeDirectoryForUser()
</a>
and the return value from that method (if non-nil)
is used to replace the tilde.
</p>
<h1><a name="002000000000">
Software documentation for the NSDirectoryEnumerator
class
</a></h1>
<h2><a name="class$NSDirectoryEnumerator">NSDirectoryEnumerator</a> : <a rel="gsdoc" href="NSEnumerator.html#class$NSEnumerator">NSEnumerator</a></h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>Foundation/NSFileManager.h</dd>
</dl>
</blockquote>
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
</p>
<p>
This is a subclass of <code>NSEnumerator</code> which
provides a full listing of all the files beneath a
directory and its subdirectories. Instances can
be obtained through
<a rel="gsdoc" href="#method$NSFileManager-enumeratorAtPath$">[NSFileManager -enumeratorAtPath:]</a>
.
</p>
<p>
</p>
<p>
This implementation is optimized and performance
should be comparable to the speed of standard Unix
tools for large directories.
</p>
<p>
</p>
<p>
The order in which directory contents are enumerated is
undefined, and in the current implementation the
natural order of the underlying filesystem is used.
</p>
<p>
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDirectoryEnumerator-directoryAttributes">-directoryAttributes</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDirectoryEnumerator-fileAttributes">-fileAttributes</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDirectoryEnumerator-skipDescendents">-skipDescendents</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$NSDirectoryEnumerator-directoryAttributes">directoryAttributes </a></h3>
- (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*) <b>directoryAttributes</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns a dictionary containing the attributes of
the directory at which enumeration started. <br /> The
contents of this dictionary are as produced by
<a rel="gsdoc" href="#method$NSFileManager-fileAttributesAtPath$traverseLink$">[NSFileManager -fileAttributesAtPath:traverseLink:]</a>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDirectoryEnumerator-fileAttributes">fileAttributes </a></h3>
- (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*) <b>fileAttributes</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns a dictionary containing the attributes of
the file currently being enumerated. <br /> The
contents of this dictionary are as produced by
<a rel="gsdoc" href="#method$NSFileManager-fileAttributesAtPath$traverseLink$">[NSFileManager -fileAttributesAtPath:traverseLink:]</a>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDirectoryEnumerator-skipDescendents">skipDescendents </a></h3>
- (void) <b>skipDescendents</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Informs the receiver that any descendents of the
current directory should be skipped rather than
enumerated. Use this to avoid enumerating the
contents of directories you are not interested in.
</div>
<hr width="25%" align="left" />
</div>
<h1><a name="003000000000">
Software documentation for the NSFileManager class
</a></h1>
<h2><a name="class$NSFileManager">NSFileManager</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>Foundation/NSFileManager.h</dd>
</dl>
</blockquote>
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
This is the main class for platform-independent
management of the local filesystem, which allows
you to read and save files, create/list directories, and
move or delete files and directories. In addition to
simply listing directories, you may obtain an
<a rel="gsdoc" href="#class$NSDirectoryEnumerator">NSDirectoryEnumerator</a>
instance for recursive directory contents
enumeration.
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager+defaultManager">+defaultManager</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-attributesOfItemAtPath$error$">-attributesOfItemAtPath:error:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-changeCurrentDirectoryPath$">-changeCurrentDirectoryPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-changeFileAttributes$atPath$">-changeFileAttributes:atPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-componentsToDisplayForPath$">-componentsToDisplayForPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-contentsAtPath$">-contentsAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-contentsEqualAtPath$andPath$">-contentsEqualAtPath:andPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-contentsOfDirectoryAtPath$error$">-contentsOfDirectoryAtPath:error:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-copyItemAtPath$toPath$error$">-copyItemAtPath:toPath:error:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-copyItemAtURL$toURL$error$">-copyItemAtURL:toURL:error:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-copyPath$toPath$handler$">-copyPath:toPath:handler:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-createDirectoryAtPath$attributes$">-createDirectoryAtPath:attributes:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-createDirectoryAtPath$withIntermediateDirectories$attributes$error$">-createDirectoryAtPath:withIntermediateDirectories:attributes:error:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-createDirectoryAtURL$withIntermediateDirectories$attributes$error$">-createDirectoryAtURL:withIntermediateDirectories:attributes:error:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-createFileAtPath$contents$attributes$">-createFileAtPath:contents:attributes:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-createSymbolicLinkAtPath$pathContent$">-createSymbolicLinkAtPath:pathContent:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-currentDirectoryPath">-currentDirectoryPath</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-directoryContentsAtPath$">-directoryContentsAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-displayNameAtPath$">-displayNameAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-enumeratorAtPath$">-enumeratorAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-fileAttributesAtPath$traverseLink$">-fileAttributesAtPath:traverseLink:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-fileExistsAtPath$">-fileExistsAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-fileExistsAtPath$isDirectory$">-fileExistsAtPath:isDirectory:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-fileSystemAttributesAtPath$">-fileSystemAttributesAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-fileSystemRepresentationWithPath$">-fileSystemRepresentationWithPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-isDeletableFileAtPath$">-isDeletableFileAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-isExecutableFileAtPath$">-isExecutableFileAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-isReadableFileAtPath$">-isReadableFileAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-isWritableFileAtPath$">-isWritableFileAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-linkPath$toPath$handler$">-linkPath:toPath:handler:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-moveItemAtPath$toPath$error$">-moveItemAtPath:toPath:error:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-moveItemAtURL$toURL$error$">-moveItemAtURL:toURL:error:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-movePath$toPath$handler$">-movePath:toPath:handler:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-pathContentOfSymbolicLinkAtPath$">-pathContentOfSymbolicLinkAtPath:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-removeFileAtPath$handler$">-removeFileAtPath:handler:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-removeItemAtPath$error$">-removeItemAtPath:error:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-removeItemAtURL$error$">-removeItemAtURL:error:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-stringWithFileSystemRepresentation$length$">-stringWithFileSystemRepresentation:length:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSFileManager-subpathsAtPath$">-subpathsAtPath:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$NSFileManager+defaultManager">defaultManager </a></h3>
+ (<a rel="gsdoc" href="#class$NSFileManager">NSFileManager</a>*) <b>defaultManager</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns a shared default file manager which may be
used throughout an application.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-attributesOfItemAtPath$error$">attributesOfItemAtPath: error: </a></h3>
- (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*) <b>attributesOfItemAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> error:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.5.0</div>
<br />
<div class="desc">
If a file (or directory etc) exists at the specified
<var>path</var>, and can be queried for its
attributes, this method returns a dictionary
containing the various attributes of that file.
Otherwise <code>nil</code> is returned. <br /> If
an <var>error</var> occurs, <var>error</var> describes
the problem. Pass NULL if you do not want
<var>error</var> information.
</p>
<p>
The dictionary keys for attributes are -
</p>
<p>
<dl>
<dt><code>NSFileAppendOnly</code></dt>
<dd>
NSNumber... boolean
</dd>
<dt><code>NSFileCreationDate</code></dt>
<dd>
NSDate when the file was created (if supported)
</dd>
<dt><code>NSFileDeviceIdentifier</code></dt>
<dd>
NSNumber (identifies the device on which the
file is stored)
</dd>
<dt><code>NSFileExtensionHidden</code></dt>
<dd>
NSNumber... boolean
</dd>
<dt>
<code>NSFileGroupOwnerAccountName</code>
</dt>
<dd>
NSString name of the file group
</dd>
<dt>
<code>NSFileGroupOwnerAccountID</code>
</dt>
<dd>
NSNumber ID of the file group
</dd>
<dt><code>NSFileHFSCreatorCode</code></dt>
<dd>
NSNumber not used
</dd>
<dt><code>NSFileHFSTypeCode</code></dt>
<dd>
NSNumber not used
</dd>
<dt><code>NSFileImmutable</code></dt>
<dd>
NSNumber... boolean
</dd>
<dt><code>NSFileModificationDate</code></dt>
<dd>
NSDate when the file was last modified
</dd>
<dt><code>NSFileOwnerAccountName</code></dt>
<dd>
NSString name of the file owner
</dd>
<dt><code>NSFileOwnerAccountID</code></dt>
<dd>
NSNumber ID of the file owner
</dd>
<dt><code>NSFilePosixPermissions</code></dt>
<dd>
NSNumber posix access permissions mask
</dd>
<dt><code>NSFileReferenceCount</code></dt>
<dd>
NSNumber number of links to this file
</dd>
<dt><code>NSFileSize</code></dt>
<dd>
NSNumber size of the file in bytes
</dd>
<dt><code>NSFileSystemFileNumber</code></dt>
<dd>
NSNumber the identifier for the file on the
filesystem
</dd>
<dt><code>NSFileSystemNumber</code></dt>
<dd>
NSNumber the filesystem on which the file is
stored
</dd>
<dt><code>NSFileType</code></dt>
<dd>
NSString the type of file
</dd>
</dl>
</p>
<p>
The
<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>
class also has a set of convenience accessor
methods which enable you to get at file
attribute information more efficiently than
using the keys above to extract it. You should
generally use the accessor methods where they
are available.
</p>
<p>
<ul>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileCreationDate">[NSDictionary(NSFileAttributes) -fileCreationDate]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileExtensionHidden">[NSDictionary(NSFileAttributes) -fileExtensionHidden]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileHFSCreatorCode">[NSDictionary(NSFileAttributes) -fileHFSCreatorCode]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileHFSTypeCode">[NSDictionary(NSFileAttributes) -fileHFSTypeCode]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileIsAppendOnly">[NSDictionary(NSFileAttributes) -fileIsAppendOnly]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileIsImmutable">[NSDictionary(NSFileAttributes) -fileIsImmutable]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileSize">[NSDictionary(NSFileAttributes) -fileSize]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileType">[NSDictionary(NSFileAttributes) -fileType]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileOwnerAccountName">[NSDictionary(NSFileAttributes) -fileOwnerAccountName]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileOwnerAccountID">[NSDictionary(NSFileAttributes) -fileOwnerAccountID]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileGroupOwnerAccountName">[NSDictionary(NSFileAttributes) -fileGroupOwnerAccountName]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileGroupOwnerAccountID">[NSDictionary(NSFileAttributes) -fileGroupOwnerAccountID]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileModificationDate">[NSDictionary(NSFileAttributes) -fileModificationDate]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-filePosixPermissions">[NSDictionary(NSFileAttributes) -filePosixPermissions]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileSystemNumber">[NSDictionary(NSFileAttributes) -fileSystemNumber]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileSystemFileNumber">[NSDictionary(NSFileAttributes) -fileSystemFileNumber]</a>
</li>
</ul>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-changeCurrentDirectoryPath$">changeCurrentDirectoryPath: </a></h3>
- (BOOL) <b>changeCurrentDirectoryPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Changes the current directory used for all
subsequent operations. <br /> All non-absolute
paths are interpreted relative to this directory.
<br /> The current directory is set on a per-task
basis, so the current directory for other file
manager instances will also be changed by this
method.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-changeFileAttributes$atPath$">changeFileAttributes: atPath: </a></h3>
- (BOOL) <b>changeFileAttributes:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)attributes<b> atPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Change the <var>attributes</var> of the file at
<var>path</var> to those specified. <br /> Returns
<code>YES</code> if all requested changes were made
(or if the dictionary was <code>nil</code> or empty, so
no changes were requested), <code>NO</code> otherwise.
<br /> On failure, some of the requested changes may
have taken place. <br />
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-componentsToDisplayForPath$">componentsToDisplayForPath: </a></h3>
- (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*) <b>componentsToDisplayForPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns an array of <var>path</var> components
suitably modified for display to the end user.
This modification may render the returned strings
unusable for <var>path</var> manipulation, so you
should work with two arrays... one returned by this
method (for display to the user), and a parallel one
returned by
<a rel="gsdoc" href="NSString.html#method$NSString-pathComponents">
[NSString -pathComponents]
</a>
(for <var>path</var> manipulation).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-contentsAtPath$">contentsAtPath: </a></h3>
- (<a rel="gsdoc" href="NSData.html#class$NSData">NSData</a>*) <b>contentsAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Reads the file at <var>path</var> an returns its
contents as an NSData object. <br /> If an error
occurs or if <var>path</var> specifies a directory
etc then <code>nil</code> is returned.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-contentsEqualAtPath$andPath$">contentsEqualAtPath: andPath: </a></h3>
- (BOOL) <b>contentsEqualAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path1<b> andPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path2;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns <code>YES</code> if the contents of the
file or directory at <var>path1</var> are the same as
those at <var>path2</var>. <br /> If <var>path1</var>
and <var>path2</var> are files, this is a simple
comparison. If they are directories, the
contents of the files in those subdirectories are
compared recursively. <br /> Symbolic links are
not followed. <br /> A comparison checks first file
identity, then size, then content.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-contentsOfDirectoryAtPath$error$">contentsOfDirectoryAtPath: error: </a></h3>
- (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*) <b>contentsOfDirectoryAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> error:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.5.0</div>
<br />
<div class="desc">
Returns an array of the contents of the specified
directory. <br /> The listing does
<strong>not</strong> recursively list
subdirectories. <br /> The special files
'.' and '..' are not listed. <br /> Indicates an
<var>error</var> by returning <code>nil</code> (eg.
if <var>path</var> is not a directory or it can't be
read for some reason).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-copyItemAtPath$toPath$error$">copyItemAtPath: toPath: error: </a></h3>
- (BOOL) <b>copyItemAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)src<b> toPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)dst<b> error:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.5.0</div>
<br />
<div class="desc">
Copies the item specified by the <var>src</var> path
to the location specified by the <var>dst</var> path. If
the <var>src</var> is a directory, it is copied
recursively with all of its contents. <br />
Errors are returned in the <var>error</var>
variable. Returns <code>YES</code> on success,
<code>NO</code> otherwise.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-copyItemAtURL$toURL$error$">copyItemAtURL: toURL: error: </a></h3>
- (BOOL) <b>copyItemAtURL:</b> (<a rel="gsdoc" href="NSURL.html#class$NSURL">NSURL</a>*)src<b> toURL:</b> (<a rel="gsdoc" href="NSURL.html#class$NSURL">NSURL</a>*)dst<b> error:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.5.0</div>
<br />
<div class="desc">
Copies the a file or directory specified by the
<var>src</var> URL to the location specified by the
<var>dst</var> URL. If the <var>src</var> is a
directory, it is copied recursively with all of
its contents. <br /> Errors are returned in the
<var>error</var> variable. Returns <code>YES</code>
on success, <code>NO</code> otherwise.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-copyPath$toPath$handler$">copyPath: toPath: handler: </a></h3>
- (BOOL) <b>copyPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)source<b> toPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)destination<b> handler:</b> (id)handler;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Copies the file or directory at <var>source</var> to
<var>destination</var>, using a <var>handler</var>
object which should respond to
<a rel="gsdoc" href="#method$NSObject(NSFileManagerHandler)-fileManager$willProcessPath$">[NSObject(NSFileManagerHandler) -fileManager:willProcessPath:]</a>
and <a rel="gsdoc" href="#method$NSObject(NSFileManagerHandler)-fileManager$shouldProceedAfterError$">[NSObject(NSFileManagerHandler) -fileManager:shouldProceedAfterError:]</a>
messages. <br /> Will not copy to a <var>destination</var> which already exists.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-createDirectoryAtPath$attributes$">createDirectoryAtPath: attributes: </a></h3>
- (BOOL) <b>createDirectoryAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> attributes:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)attributes;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Creates a new directory, and sets its
<var>attributes</var> as specified. <br /> Fails if
directories in the <var>path</var> are missing.
<br /> Returns <code>YES</code> if the directory was
created (or already exists), <code>NO</code>
otherwise.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-createDirectoryAtPath$withIntermediateDirectories$attributes$error$">createDirectoryAtPath: withIntermediateDirectories: attributes: error: </a></h3>
- (BOOL) <b>createDirectoryAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> withIntermediateDirectories:</b> (BOOL)flag<b> attributes:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)attributes<b> error:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Creates a new directory and all intermediate
directories. if <var>flag</var> is
<code>YES</code>. Creates only the last directory in
the <var>path</var> if <var>flag</var> is
<code>NO</code>. <br /> The directory is created
with the <var>attributes</var> specified in
<var>attributes</var> and any <var>error</var> is
returned in <var>error</var>. <br /> returns
<code>YES</code> on success, <code>NO</code> on
failure.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-createDirectoryAtURL$withIntermediateDirectories$attributes$error$">createDirectoryAtURL: withIntermediateDirectories: attributes: error: </a></h3>
- (BOOL) <b>createDirectoryAtURL:</b> (<a rel="gsdoc" href="NSURL.html#class$NSURL">NSURL</a>*)url<b> withIntermediateDirectories:</b> (BOOL)flag<b> attributes:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)attributes<b> error:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Creates a new directory and all intermediate
directories in the file URL if <var>flag</var>
is <code>YES</code>. Creates only the last directory in
the URL if <var>flag</var> is <code>NO</code>. <br />
The directory is created with the <var>attributes</var>
specified in <var>attributes</var> and any
<var>error</var> is returned in <var>error</var>.
<br /> returns <code>YES</code> on success,
<code>NO</code> on failure.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-createFileAtPath$contents$attributes$">createFileAtPath: contents: attributes: </a></h3>
- (BOOL) <b>createFileAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> contents:</b> (<a rel="gsdoc" href="NSData.html#class$NSData">NSData</a>*)contents<b> attributes:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)attributes;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Creates a new file, and sets its
<var>attributes</var> as specified. <br />
Initialises the file content with the specified
data. <br /> Returns <code>YES</code> on success,
<code>NO</code> on failure.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-createSymbolicLinkAtPath$pathContent$">createSymbolicLinkAtPath: pathContent: </a></h3>
- (BOOL) <b>createSymbolicLinkAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> pathContent:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)otherPath;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Creates a symbolic link at <var>path</var> which
links to the location specified by
<var>otherPath</var>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-currentDirectoryPath">currentDirectoryPath </a></h3>
- (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>currentDirectoryPath</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns the current working directory used by all
instance of the file manager in the current task.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-directoryContentsAtPath$">directoryContentsAtPath: </a></h3>
- (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*) <b>directoryContentsAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns an array of the contents of the specified
directory. <br /> The listing does
<strong>not</strong> recursively list
subdirectories. <br /> The special files
'.' and '..' are not listed. <br /> Indicates an error
by returning <code>nil</code> (eg. if <var>path</var> is
not a directory or it can't be read for some reason).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-displayNameAtPath$">displayNameAtPath: </a></h3>
- (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>displayNameAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns the name of the file or directory at
<var>path</var>. Converts it into a format for
display to an end user. This may render it unusable
as part of a file/path name. <br /> For instance, if a
user has elected not to see file extensions, this
method may return filenames with the extension
removed. <br /> The default operation is to return
the result of calling
<a rel="gsdoc" href="NSString.html#method$NSString-lastPathComponent">[NSString -lastPathComponent]</a>
on the <var>path</var>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-enumeratorAtPath$">enumeratorAtPath: </a></h3>
- (<a rel="gsdoc" href="#class$NSDirectoryEnumerator">NSDirectoryEnumerator</a>*) <b>enumeratorAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
</p>
<p>
Returns an enumerator which can be used to return
each item with the directory at <var>path</var> in
turn.
</p>
<p>
</p>
<p>
The enumeration is recursive... following all nested
subdirectories.
</p>
<p>
</p>
<p>
The order in which directory contents are enumerated
is undefined, and in the current implementation the
natural order of the underlying filesystem is
used.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-fileAttributesAtPath$traverseLink$">fileAttributesAtPath: traverseLink: </a></h3>
- (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*) <b>fileAttributesAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> traverseLink:</b> (BOOL)flag;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
If a file (or directory etc) exists at the specified
<var>path</var>, and can be queried for its
attributes, this method returns a dictionary
containing the various attributes of that file.
Otherwise <code>nil</code> is returned. <br /> If
the <var>flag</var> is <code>NO</code> and the file is
a symbolic link, the attributes of the link itself
(rather than the file it points to) are returned.
<br />
</p>
<p>
The dictionary keys for attributes are -
</p>
<p>
<dl>
<dt><code>NSFileAppendOnly</code></dt>
<dd>
NSNumber... boolean
</dd>
<dt><code>NSFileCreationDate</code></dt>
<dd>
NSDate when the file was created (if supported)
</dd>
<dt><code>NSFileDeviceIdentifier</code></dt>
<dd>
NSNumber (identifies the device on which the
file is stored)
</dd>
<dt><code>NSFileExtensionHidden</code></dt>
<dd>
NSNumber... boolean
</dd>
<dt>
<code>NSFileGroupOwnerAccountName</code>
</dt>
<dd>
NSString name of the file group
</dd>
<dt>
<code>NSFileGroupOwnerAccountID</code>
</dt>
<dd>
NSNumber ID of the file group
</dd>
<dt><code>NSFileHFSCreatorCode</code></dt>
<dd>
NSNumber not used
</dd>
<dt><code>NSFileHFSTypeCode</code></dt>
<dd>
NSNumber not used
</dd>
<dt><code>NSFileImmutable</code></dt>
<dd>
NSNumber... boolean
</dd>
<dt><code>NSFileModificationDate</code></dt>
<dd>
NSDate when the file was last modified
</dd>
<dt><code>NSFileOwnerAccountName</code></dt>
<dd>
NSString name of the file owner
</dd>
<dt><code>NSFileOwnerAccountID</code></dt>
<dd>
NSNumber ID of the file owner
</dd>
<dt><code>NSFilePosixPermissions</code></dt>
<dd>
NSNumber posix access permissions mask
</dd>
<dt><code>NSFileReferenceCount</code></dt>
<dd>
NSNumber number of links to this file
</dd>
<dt><code>NSFileSize</code></dt>
<dd>
NSNumber size of the file in bytes
</dd>
<dt><code>NSFileSystemFileNumber</code></dt>
<dd>
NSNumber the identifier for the file on the
filesystem
</dd>
<dt><code>NSFileSystemNumber</code></dt>
<dd>
NSNumber the filesystem on which the file is
stored
</dd>
<dt><code>NSFileType</code></dt>
<dd>
NSString the type of file
</dd>
</dl>
</p>
<p>
The
<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>
class also has a set of convenience accessor
methods which enable you to get at file
attribute information more efficiently than
using the keys above to extract it. You should
generally use the accessor methods where they
are available.
</p>
<p>
<ul>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileCreationDate">[NSDictionary(NSFileAttributes) -fileCreationDate]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileExtensionHidden">[NSDictionary(NSFileAttributes) -fileExtensionHidden]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileHFSCreatorCode">[NSDictionary(NSFileAttributes) -fileHFSCreatorCode]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileHFSTypeCode">[NSDictionary(NSFileAttributes) -fileHFSTypeCode]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileIsAppendOnly">[NSDictionary(NSFileAttributes) -fileIsAppendOnly]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileIsImmutable">[NSDictionary(NSFileAttributes) -fileIsImmutable]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileSize">[NSDictionary(NSFileAttributes) -fileSize]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileType">[NSDictionary(NSFileAttributes) -fileType]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileOwnerAccountName">[NSDictionary(NSFileAttributes) -fileOwnerAccountName]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileOwnerAccountID">[NSDictionary(NSFileAttributes) -fileOwnerAccountID]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileGroupOwnerAccountName">[NSDictionary(NSFileAttributes) -fileGroupOwnerAccountName]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileGroupOwnerAccountID">[NSDictionary(NSFileAttributes) -fileGroupOwnerAccountID]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileModificationDate">[NSDictionary(NSFileAttributes) -fileModificationDate]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-filePosixPermissions">[NSDictionary(NSFileAttributes) -filePosixPermissions]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileSystemNumber">[NSDictionary(NSFileAttributes) -fileSystemNumber]</a>
</li>
<li>
<a rel="gsdoc" href="#method$NSDictionary(NSFileAttributes)-fileSystemFileNumber">[NSDictionary(NSFileAttributes) -fileSystemFileNumber]</a>
</li>
</ul>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-fileExistsAtPath$">fileExistsAtPath: </a></h3>
- (BOOL) <b>fileExistsAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns <code>YES</code> if a file (or directory
etc) exists at the specified <var>path</var>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-fileExistsAtPath$isDirectory$">fileExistsAtPath: isDirectory: </a></h3>
- (BOOL) <b>fileExistsAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> isDirectory:</b> (BOOL*)isDirectory;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns <code>YES</code> if a file (or directory
etc) exists at the specified <var>path</var>. <br />
If the <var>isDirectory</var> argument is not a nul
pointer, stores a flag in the location it points
to, indicating whether the file is a directory or not.
<br />
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-fileSystemAttributesAtPath$">fileSystemAttributesAtPath: </a></h3>
- (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*) <b>fileSystemAttributesAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns a dictionary containing the filesystem
attributes for the specified <var>path</var> (or
<code>nil</code> if the <var>path</var> is not
valid). <br />
<dl>
<dt><code>NSFileSystemSize</code></dt>
<dd>
NSNumber the size of the filesystem in bytes
</dd>
<dt><code>NSFileSystemFreeSize</code></dt>
<dd>
NSNumber the amount of unused space on the
filesystem in bytes
</dd>
<dt><code>NSFileSystemNodes</code></dt>
<dd>
NSNumber the number of nodes in use to store
files
</dd>
<dt><code>NSFileSystemFreeNodes</code></dt>
<dd>
NSNumber the number of nodes available to
create files
</dd>
<dt><code>NSFileSystemNumber</code></dt>
<dd>
NSNumber the identifying number for the
filesystem
</dd>
</dl>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-fileSystemRepresentationWithPath$">fileSystemRepresentationWithPath: </a></h3>
- (const GSNativeChar*) <b>fileSystemRepresentationWithPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Convert from OpenStep internal string format to a
string in the local filesystem format, suitable for
passing to system functions. <br /> This
representation may vary between filesystems.
<br /> Converts the standard <var>path</var>
separator ('/') and <var>path</var> extension
('.') characters to the local representation if
necessary. <br /> On mingw32 systems, the
filesystem representation is 16-bit unicode and
is expected to be used in conjunction with the variants
of system calls which work with unicode strings. <br />
Raises an exception if the character conversion is
not possible.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-isDeletableFileAtPath$">isDeletableFileAtPath: </a></h3>
- (BOOL) <b>isDeletableFileAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns <code>YES</code> if a file (or directory
etc) exists at the specified <var>path</var> and is
deletable.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-isExecutableFileAtPath$">isExecutableFileAtPath: </a></h3>
- (BOOL) <b>isExecutableFileAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns <code>YES</code> if a file (or directory
etc) exists at the specified <var>path</var> and is
executable (if a directory is executable, you
can access its contents).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-isReadableFileAtPath$">isReadableFileAtPath: </a></h3>
- (BOOL) <b>isReadableFileAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns <code>YES</code> if a file (or directory
etc) exists at the specified <var>path</var> and is
readable.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-isWritableFileAtPath$">isWritableFileAtPath: </a></h3>
- (BOOL) <b>isWritableFileAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns <code>YES</code> if a file (or directory
etc) exists at the specified <var>path</var> and is
writable.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-linkPath$toPath$handler$">linkPath: toPath: handler: </a></h3>
- (BOOL) <b>linkPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)source<b> toPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)destination<b> handler:</b> (id)handler;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
</p>
<p>
Links the file or directory at <var>source</var> to
<var>destination</var>, using a <var>handler</var>
object which should respond to
<a rel="gsdoc" href="#method$NSObject(NSFileManagerHandler)-fileManager$willProcessPath$">[NSObject(NSFileManagerHandler) -fileManager:willProcessPath:]</a>
and <a rel="gsdoc" href="#method$NSObject(NSFileManagerHandler)-fileManager$shouldProceedAfterError$">[NSObject(NSFileManagerHandler) -fileManager:shouldProceedAfterError:]</a>
messages.
</p>
<p>
</p>
<p>
If the <var>destination</var> is a directory, the
<var>source</var> path is linked into that
directory, otherwise the
<var>destination</var> must not exist, but its
parent directory must exist and the
<var>source</var> will be linked into the parent as
the name specified by the <var>destination</var>.
</p>
<p>
</p>
<p>
If the <var>source</var> is a symbolic link, it is
copied to the <var>destination</var>. <br /> If
the <var>source</var> is a directory, it is copied to
the <var>destination</var> and its contents are
linked into the new directory. <br /> Otherwise, a
hard link is made from the <var>destination</var> to
the <var>source</var>.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-moveItemAtPath$toPath$error$">moveItemAtPath: toPath: error: </a></h3>
- (BOOL) <b>moveItemAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)src<b> toPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)dst<b> error:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.5.0</div>
<br />
<div class="desc">
Moves a file or directory specified by <var>src</var>
to its destination specified by <var>dst</var>, errors
are returned in <var>error</var>. <br /> Returns
<code>YES</code> on success, <code>NO</code>
otherwise.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-moveItemAtURL$toURL$error$">moveItemAtURL: toURL: error: </a></h3>
- (BOOL) <b>moveItemAtURL:</b> (<a rel="gsdoc" href="NSURL.html#class$NSURL">NSURL</a>*)src<b> toURL:</b> (<a rel="gsdoc" href="NSURL.html#class$NSURL">NSURL</a>*)dst<b> error:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.5.0</div>
<br />
<div class="desc">
Moves a file or directory specified by <var>src</var>
to its destination specified by <var>dst</var>, errors
are returned in <var>error</var>. <br /> Returns
<code>YES</code> on success, <code>NO</code>
otherwise.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-movePath$toPath$handler$">movePath: toPath: handler: </a></h3>
- (BOOL) <b>movePath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)source<b> toPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)destination<b> handler:</b> (id)handler;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Moves the file or directory at <var>source</var> to
<var>destination</var>, using a <var>handler</var>
object which should respond to
<a rel="gsdoc" href="#method$NSObject(NSFileManagerHandler)-fileManager$willProcessPath$">[NSObject(NSFileManagerHandler) -fileManager:willProcessPath:]</a>
and <a rel="gsdoc" href="#method$NSObject(NSFileManagerHandler)-fileManager$shouldProceedAfterError$">[NSObject(NSFileManagerHandler) -fileManager:shouldProceedAfterError:]</a>
messages. Will not move to a <var>destination</var> which already exists. <br />
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-pathContentOfSymbolicLinkAtPath$">pathContentOfSymbolicLinkAtPath: </a></h3>
- (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>pathContentOfSymbolicLinkAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns the name of the file or directory that the
symbolic link at <var>path</var> points to.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-removeFileAtPath$handler$">removeFileAtPath: handler: </a></h3>
- (BOOL) <b>removeFileAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> handler:</b> (id)handler;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Removes the file or directory at <var>path</var>,
using a <var>handler</var> object which should
respond to
<a rel="gsdoc" href="#method$NSObject(NSFileManagerHandler)-fileManager$willProcessPath$">[NSObject(NSFileManagerHandler) -fileManager:willProcessPath:]</a>
and <a rel="gsdoc" href="#method$NSObject(NSFileManagerHandler)-fileManager$shouldProceedAfterError$">[NSObject(NSFileManagerHandler) -fileManager:shouldProceedAfterError:]</a>
messages.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-removeItemAtPath$error$">removeItemAtPath: error: </a></h3>
- (BOOL) <b>removeItemAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> error:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.5.0</div>
<br />
<div class="desc">
Removes the file or directory specified by the
<var>path</var> to be removed. If the <var>path</var>
points to a directory, the directory is deleted
recursively. <br /> Returns <code>YES</code>
on success, otherwise <code>NO</code>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-removeItemAtURL$error$">removeItemAtURL: error: </a></h3>
- (BOOL) <b>removeItemAtURL:</b> (<a rel="gsdoc" href="NSURL.html#class$NSURL">NSURL</a>*)url<b> error:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.5.0</div>
<br />
<div class="desc">
Removes the file or directory specified by the
<var>url</var> to be removed. If the <var>url</var>
points to a directory, the directory is deleted
recursively. <br /> Returns <code>YES</code>
on success, otherwise <code>NO</code>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-stringWithFileSystemRepresentation$length$">stringWithFileSystemRepresentation: length: </a></h3>
- (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>stringWithFileSystemRepresentation:</b> (const GSNativeChar*)string<b> length:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)len;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Convert to OpenStep internal <var>string</var>
format from a <var>string</var> in the local
filesystem format, as returned by system
functions. <br /> This representation may vary
between filesystems. <br /> The GNUstep version of
this method currently does not bother to change any
path separator and extension characters to the
standard values ('/' and '.' respectively) as the
path handling methods of
<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>
should be able to handle native format strings.
<br /> On mingw32 systems, the filesystem
representation is 16-bit unicode and is
expected to have come from the variant of a
system call which works with unicode strings.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFileManager-subpathsAtPath$">subpathsAtPath: </a></h3>
- (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*) <b>subpathsAtPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns an array containing the (relative) paths of
all the items in the directory at <var>path</var>.
<br /> The listing follows all subdirectories, so it
can produce a very large array... use with care.
</div>
<hr width="25%" align="left" />
</div>
<h1><a name="004000000000">
Software documentation for the
NSDictionary(NSFileAttributes)
category
</a></h1>
<h2><a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>(<a name="category$NSDictionary(NSFileAttributes)">NSFileAttributes</a>)</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>Foundation/NSFileManager.h</dd>
</dl>
</blockquote>
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Convenience methods for accessing named file
attributes in a dictionary.
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileCreationDate">-fileCreationDate</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileExtensionHidden">-fileExtensionHidden</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileGroupOwnerAccountID">-fileGroupOwnerAccountID</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileGroupOwnerAccountName">-fileGroupOwnerAccountName</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileHFSCreatorCode">-fileHFSCreatorCode</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileHFSTypeCode">-fileHFSTypeCode</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileIsAppendOnly">-fileIsAppendOnly</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileIsImmutable">-fileIsImmutable</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileModificationDate">-fileModificationDate</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileOwnerAccountID">-fileOwnerAccountID</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileOwnerAccountName">-fileOwnerAccountName</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-filePosixPermissions">-filePosixPermissions</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileSize">-fileSize</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileSystemFileNumber">-fileSystemFileNumber</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileSystemNumber">-fileSystemNumber</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSDictionary(NSFileAttributes)-fileType">-fileType</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileCreationDate">fileCreationDate </a></h3>
- (<a rel="gsdoc" href="NSDate.html#class$NSDate">NSDate</a>*) <b>fileCreationDate</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file creation date attribute (or
<code>nil</code> if not found).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileExtensionHidden">fileExtensionHidden </a></h3>
- (BOOL) <b>fileExtensionHidden</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file extension hidden attribute (or
<code>NO</code> if not found).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileGroupOwnerAccountID">fileGroupOwnerAccountID </a></h3>
- (<a rel="gsdoc" href="NSValue.html#class$NSNumber">NSNumber</a>*) <b>fileGroupOwnerAccountID</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return an NSNumber with the numeric value of the
NSFileGroupOwnerAccountID
attribute in the dictionary, or <code>nil</code>
if the attribute is not present.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileGroupOwnerAccountName">fileGroupOwnerAccountName </a></h3>
- (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>fileGroupOwnerAccountName</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file group owner account name attribute
or <code>nil</code> if not present.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileHFSCreatorCode">fileHFSCreatorCode </a></h3>
- (<a rel="gsdoc" href="TypesAndConstants.html#type$OSType">OSType</a>) <b>fileHFSCreatorCode</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns HFS creator attribute (OS X).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileHFSTypeCode">fileHFSTypeCode </a></h3>
- (<a rel="gsdoc" href="TypesAndConstants.html#type$OSType">OSType</a>) <b>fileHFSTypeCode</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Returns HFS type code attribute (OS X).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileIsAppendOnly">fileIsAppendOnly </a></h3>
- (BOOL) <b>fileIsAppendOnly</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file append only attribute (or
<code>NO</code> if not found).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileIsImmutable">fileIsImmutable </a></h3>
- (BOOL) <b>fileIsImmutable</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file immutable attribute (or
<code>NO</code> if not found).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileModificationDate">fileModificationDate </a></h3>
- (<a rel="gsdoc" href="NSDate.html#class$NSDate">NSDate</a>*) <b>fileModificationDate</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file modification date attribute (or
<code>nil</code> if not found)
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileOwnerAccountID">fileOwnerAccountID </a></h3>
- (<a rel="gsdoc" href="NSValue.html#class$NSNumber">NSNumber</a>*) <b>fileOwnerAccountID</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return an NSNumber with the numeric value of the
NSFileOwnerAccountID attribute in the
dictionary, or <code>nil</code> if the
attribute is not present.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileOwnerAccountName">fileOwnerAccountName </a></h3>
- (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>fileOwnerAccountName</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file owner account name attribute or
<code>nil</code> if not present.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-filePosixPermissions">filePosixPermissions </a></h3>
- (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>) <b>filePosixPermissions</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file posix permissions attribute (or
NSNotFound if the attribute is not present in
the dictionary).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileSize">fileSize </a></h3>
- (unsigned long long) <b>fileSize</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the size of the file, or NSNotFound if the
file size attribute is not found in the dictionary.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileSystemFileNumber">fileSystemFileNumber </a></h3>
- (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>) <b>fileSystemFileNumber</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file system file identification number
attribute or NSNotFound if the attribute is not
present in the dictionary).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileSystemNumber">fileSystemNumber </a></h3>
- (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>) <b>fileSystemNumber</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file system number attribute (or
NSNotFound if the attribute is not present in
the dictionary).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSDictionary(NSFileAttributes)-fileType">fileType </a></h3>
- (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>fileType</b>;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Return the file type attribute or <code>nil</code>
if not present.
</div>
<hr width="25%" align="left" />
</div>
<h1><a name="005000000000">
Software documentation for the
NSObject(NSFileManagerHandler)
informal protocol
</a></h1>
<h2><a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a>(<a name="category$NSObject(NSFileManagerHandler)">NSFileManagerHandler</a>)</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>Foundation/NSFileManager.h</dd>
</dl>
</blockquote>
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
An informal protocol to which handler objects should
conform if they wish to deal with copy and move
operations performed by NSFileManager.
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSObject(NSFileManagerHandler)-fileManager$shouldProceedAfterError$">-fileManager:shouldProceedAfterError:</a></li>
<li><a rel="gsdoc" href="NSFileManager.html#method$NSObject(NSFileManagerHandler)-fileManager$willProcessPath$">-fileManager:willProcessPath:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$NSObject(NSFileManagerHandler)-fileManager$shouldProceedAfterError$">fileManager: shouldProceedAfterError: </a></h3>
- (BOOL) <b>fileManager:</b> (<a rel="gsdoc" href="#class$NSFileManager">NSFileManager</a>*)fileManager<b> shouldProceedAfterError:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)errorDictionary;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
</p>
<p>
When an error occurs during a copy or move
operation, the file manager will send this
message to the handler, and will use the return
value to determine whether the operation should
proceed. If the method returns <code>YES</code>
then the operation will proceed after the error, if
it returns <code>NO</code> then it will be aborted.
</p>
<p>
</p>
<p>
If the handler does not implement this method it will
be treated as if it returns <code>NO</code>.
</p>
<p>
The error dictionary contains the following
<ul>
<li>
<strong>"Error"</strong> contains a
description of the error.
</li>
<li>
<strong>"Path"</strong> contains the path that
is being processed when an error occurred. If an
error occurs during an operation involving two
files, like copying, and it is not clear which
file triggers the error it will default to the
source file.
</li>
<li>
<strong>"FromPath"</strong> (Optional)
contains the path involved in reading.
</li>
<li>
<strong>"ToPath"</strong> (Optional) contains
the path involved in writing.
</li>
</ul>
</p>
<p>
Note that the <code>FromPath</code> is a GNUstep
extension.
</p>
<p>
</p>
<p>
Also the <code>FromPath</code> and
<code>ToPath</code> are filled in when
appropriate. So when copying a file they
will typically both have a value and when reading
only <code>FromPath</code>.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSObject(NSFileManagerHandler)-fileManager$willProcessPath$">fileManager: willProcessPath: </a></h3>
- (void) <b>fileManager:</b> (<a rel="gsdoc" href="#class$NSFileManager">NSFileManager</a>*)fileManager<b> willProcessPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
The file manager sends this method to the handler
immediately before performing part of a
directory move or copy operation. This provides
the handler object with information it can use in the
event of an error, to decide whether processing
should proceed after the error.
</div>
<hr width="25%" align="left" />
</div>
<br />
<a href="Base.html">Up</a>
</font>
</body>
</html>
|