Changeset 487c5d58 in rtems
- Timestamp:
- 09/28/98 22:08:41 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 0f58ab42
- Parents:
- cb646cb9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/new_chapters/files.t
rcb646cb9 r487c5d58 18 18 @item @code{opendir} - Open a Directory 19 19 @item @code{readdir} - Reads a directory 20 @item @code{readdir_r} -21 20 @item @code{rewinddir} - Resets the @code{readdir()} pointer 22 21 @item @code{scandir} - Scan a directory for matching entries … … 42 41 @item @code{chown} - Changes the owner and/ or group of a file 43 42 @item @code{utime} - Change access and/or modification times of an inode 44 @item @code{ftrunc tate} -43 @item @code{ftruncate} - Truncate a file to a specified length 45 44 @item @code{pathconf} - Gets configuration values for files 46 45 @item @code{fpathconf} - Get configuration values for files … … 83 82 Search permission was denied on a component of the path 84 83 prefix of @code{dirname}, or read permission is denied 85 for the directory itself. 86 87 @item E 88 The 84 85 @item EMFILE 86 Too many file descriptors in use by process 87 88 @item ENFILE 89 Too many files are currently open in the system. 90 91 @item ENOENT 92 Directory does not exist, or @code{name} is an empty string. 93 94 @item ENOMEM 95 Insufficient memory to complete the operation. 96 97 @item ENOTDIR 98 @item{Name} is not a directory. 89 99 90 100 @end table … … 149 159 150 160 @page 151 @subsection readdir_r - 152 153 @subheading CALLING SEQUENCE: 154 155 @ifset is-C 156 @example 157 int readdir_r( 158 ); 159 @end example 160 @end ifset 161 162 @ifset is-Ada 163 @end ifset 164 165 @subheading STATUS CODES: 166 167 @table @b 168 @item E 169 The 170 171 @end table 172 173 @subheading DESCRIPTION: 174 175 @subheading NOTES: 176 177 XXX must be implemented in RTEMS. 178 179 @page 180 @subsection rewinddir - Resets the @code{readdir()} pointer 161 @subsection rewinddir - Resets the readdir() pointer 181 162 182 163 @subheading CALLING SEQUENCE: … … 187 168 #include <dirent.h> 188 169 189 void rewinddir(DIR *dirp 170 void rewinddir( 171 DIR *dirp 190 172 ); 191 173 @end example … … 219 201 #include <dirent.h> 220 202 221 int scandir(const char *dir, 222 struct direct ***namelist, 223 int (*select)(const struct dirent *), 224 int (*compar)(const struct dirent **, const struct dirent **) 203 int scandir( 204 const char *dir, 205 struct direct ***namelist, 206 int (*select)(const struct dirent *), 207 int (*compar)(const struct dirent **, const struct dirent **) 225 208 ); 226 209 @end example … … 260 243 #include <dirent.h> 261 244 262 off_t telldir( DIR *dir 245 off_t telldir( 246 DIR *dir 263 247 ); 264 248 @end example … … 296 280 #include <dirent.h> 297 281 298 int closedir(DIR *dirp 282 int closedir( 283 DIR *dirp 299 284 ); 300 285 @end example … … 335 320 #include <unistd.h> 336 321 337 int chdir( const char *path 322 int chdir( 323 const char *path 338 324 ); 339 325 @end example … … 371 357 changed. 372 358 373 @subheading NOTES: None 359 @subheading NOTES: 360 361 None 374 362 375 363 @page … … 382 370 #include <unistd.h> 383 371 384 int getcwd( 385 ); 372 int getcwd( void ); 386 373 @end example 387 374 @end ifset … … 548 535 #include <fcntl.h> 549 536 550 int creat(const char *path, 551 mode_t mode 537 int creat( 538 const char *path, 539 mode_t mode 552 540 ); 553 541 @end example … … 561 549 @table @b 562 550 @item EEXIST 563 @code{ Path} already exists and O_CREAT and O_EXCL were used.551 @code{path} already exists and O_CREAT and O_EXCL were used. 564 552 @item EISDIR 565 @code{ Path} refers to a directory and the access requested involved553 @code{path} refers to a directory and the access requested involved 566 554 writing 567 555 @item ETXTBSY 568 @code{ Path} refers to an executable image which is currently being556 @code{path} refers to an executable image which is currently being 569 557 executed and write access was requested 570 558 @item EFAULT 571 @code{ Path} points outside your accessible address space559 @code{path} points outside your accessible address space 572 560 @item EACCES 573 561 The requested access to the file is not allowed, or one of the 574 562 directories in @code{path} did not allow search (execute) permission. 575 563 @item ENAMETOOLONG 576 @code{ Path} was too long.564 @code{path} was too long. 577 565 @item ENOENT 578 566 A directory component in @code{path} does not exist or is a dangling … … 589 577 Insufficient kernel memory was available. 590 578 @item EROFS 591 @code{ Path} refers to a file on a read-only filesystem and write access579 @code{path} refers to a file on a read-only filesystem and write access 592 580 was requested 593 581 … … 599 587 use in read, write, etc. 600 588 601 @subheading NOTES: None 589 @subheading NOTES: 590 591 None 602 592 603 593 The routine is implemented in Cygnus newlib. … … 632 622 created file. 633 623 634 @subheading NOTES: None 624 @subheading NOTES: 625 626 None 635 627 636 628 The @code{cmask} argument should have only permission bits set. All other … … 701 693 The callder may (or may not) need permission to access the existing file. 702 694 703 @subheading NOTES: None 695 @subheading NOTES: 696 697 None 704 698 705 699 @page … … 757 751 empty. 758 752 759 @subheading NOTES: None 753 @subheading NOTES: 754 755 None 760 756 761 757 @page … … 770 766 771 767 772 int mkfifo(const char *path, 773 mode_t mode 768 int mkfifo( 769 const char *path, 770 mode_t mode 774 771 ); 775 772 @end example … … 805 802 user ID and group ID. 806 803 807 @subheading NOTES: None 804 @subheading NOTES: 805 806 None 808 807 809 808 @page … … 855 854 file is no longer accessible. 856 855 857 @subheading NOTES: None 856 @subheading NOTES: 857 858 None 858 859 859 860 @page … … 866 867 #include <unistd.h> 867 868 868 int rmdir(const char *pathname 869 int rmdir( 870 const char *pathname 869 871 ); 870 872 @end example … … 881 883 of directories. 882 884 @item EFAULT 883 @c doe{Pathname} points ouside your accessible address space.885 @code{pathname} points ouside your accessible address space. 884 886 @item EACCES 885 887 Write access to the directory containing @code{pathname} was not … … 891 893 be delected nor that of the director containing it. 892 894 @item ENAMETOOLONG 893 @code{ Pathname} was too long.895 @code{pathname} was too long. 894 896 @item ENOENT 895 897 A dirctory component in @code{pathname} does not exist or is a 896 898 dangling sybolic link. 897 899 @item ENOTDIR 898 @code{ Pathname}, or a component used as a directory in @code{pathname},900 @code{pathname}, or a component used as a directory in @code{pathname}, 899 901 is not, in fact, a directory. 900 902 @item ENOTEMPTY 901 @code{ Pathname} contains entries other than . and .. .903 @code{pathname} contains entries other than . and .. . 902 904 @item EBUSY 903 @code{ Pathname} is the current working directory or root directory of905 @code{pathname} is the current working directory or root directory of 904 906 some process 905 907 @item EBUSY 906 @code{ Pathname} is the current directory or root directory of some908 @code{pathname} is the current directory or root directory of some 907 909 process. 908 910 @item ENOMEM 909 911 Insufficient kernel memory was available 910 912 @item EROGS 911 @code{ Pathname} refers to a file on a read-only filesystem.912 @item ELOOP913 @code{ Pathname} contains a reference to a circular symbolic link913 @code{pathname} refers to a file on a read-only filesystem. 914 @item ELOOP 915 @code{pathname} contains a reference to a circular symbolic link 914 916 915 917 @end table … … 920 922 921 923 922 @subheading NOTES: None 924 @subheading NOTES: 925 926 None 923 927 924 928 @page … … 931 935 #include <unistd.h> 932 936 933 int rename(const char *old, 934 const char *new 937 int rename( 938 const char *old, 939 const char *new 935 940 ); 936 941 @end example … … 1006 1011 #include <sys/stat.h> 1007 1012 1008 int stat(const char *path, 1009 struct stat *buf 1013 int stat( 1014 const char *path, 1015 struct stat *buf 1010 1016 ); 1011 1017 @end example … … 1041 1047 @code{but}. 1042 1048 1043 @subheading NOTES: None 1049 @subheading NOTES: 1050 1051 None 1044 1052 1045 1053 @page … … 1053 1061 #include <sys/stat.h> 1054 1062 1055 int fstat(int fildes, 1056 struct stat *buf 1063 int fstat( 1064 int fildes, 1065 struct stat *buf 1057 1066 ); 1058 1067 @end example … … 1087 1096 #include <unistd.h> 1088 1097 1089 int access(const char *pathname, 1090 int mode 1098 int access( 1099 const char *pathname, 1100 int mode 1091 1101 ); 1092 1102 @end example … … 1103 1113 one of the directories in @code{pathname}. 1104 1114 @item EFAULT 1105 @code{ Pathname} points outside your accessible address space.1115 @code{pathname} points outside your accessible address space. 1106 1116 @item EINVAL 1107 1117 @code{Mode} was incorrectly specified. 1108 1118 @item ENAMETOOLONG 1109 @code{ Pathname} is too long.1119 @code{pathname} is too long. 1110 1120 @item ENOENT 1111 1121 A directory component in @code{pathname} would have been accessible but … … 1128 1138 @code{Mode} is a mask consisting of one or more of R_OK, W_OK, X_OK and F_OK. 1129 1139 1130 @subheading NOTES: None 1140 @subheading NOTES: 1141 1142 None 1131 1143 1132 1144 @page … … 1191 1203 #include <sys/stat.h> 1192 1204 1193 int fchmod(int fildes, 1194 mote_t mode 1205 int fchmod( 1206 int fildes, 1207 mode_t mode 1195 1208 ); 1196 1209 @end example … … 1208 1221 The descriptor is not valid. 1209 1222 @item EFAULT 1210 @code{ Path} points outside your accessible address space.1223 @code{path} points outside your accessible address space. 1211 1224 @item EIO 1212 1225 A low-level I/o error occurred while modifying the inode. 1213 1226 @item ELOOP 1214 @code{ Path} contains a circular reference1227 @code{path} contains a circular reference 1215 1228 @item ENAMETOOLONG 1216 1229 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is … … 1235 1248 @code{filedes} is changed. 1236 1249 1237 @subheading NOTES: None 1250 @subheading NOTES: 1251 1252 None 1238 1253 1239 1254 @page … … 1248 1263 #include <linux/unistd.h> 1249 1264 1250 long getdents(int dd_fd, 1251 char *dd_buf, 1252 int dd_len 1265 long getdents( 1266 int dd_fd, 1267 char *dd_buf, 1268 int dd_len 1253 1269 ); 1254 1270 @end example … … 1331 1347 1332 1348 This function may be restricted for some file. The @code{pathconf} function 1333 can be used to test the _PC_CHOWN_RESTRICTEDflag.1349 can be used to test the @code{_PC_CHOWN_RESTRICTED} flag. 1334 1350 1335 1351 … … 1344 1360 #include <sys/types.h> 1345 1361 1346 int utime(const char *filename, 1347 struct utimbuf *buf 1362 int utime( 1363 const char *filename, 1364 struct utimbuf *buf 1348 1365 ); 1349 1366 @end example … … 1370 1387 access and modification times of the file are set to the current time. 1371 1388 1372 @subheading NOTES: 1373 1374 @page 1375 @subsection ftrunctate - 1376 1377 @subheading CALLING SEQUENCE: 1378 1379 @ifset is-C 1380 @example 1389 @subheading NOTES: None 1390 1391 @page 1392 @subsection ftruncate - truncate a file to a specified length 1393 1394 @subheading CALLING SEQUENCE: 1395 1396 @ifset is-C 1397 @example 1398 #include <unistd.h> 1399 1381 1400 int ftrunctate( 1382 ); 1383 @end example 1384 @end ifset 1385 1386 @ifset is-Ada 1387 @end ifset 1388 1389 @subheading STATUS CODES: 1390 1391 @table @b 1392 @item E 1393 The 1394 1395 @end table 1396 1397 @subheading DESCRIPTION: 1398 1399 @subheading NOTES: 1401 const char *path, 1402 size_t length 1403 ); 1404 @end example 1405 @end ifset 1406 1407 @ifset is-Ada 1408 @end ifset 1409 1410 @subheading STATUS CODES: 1411 1412 @table @b 1413 @item ENOTDIR 1414 A component of the path prefix is not a directory. 1415 1416 @item EINVAL 1417 The pathname contains a character with the high-order bit set. 1418 1419 @item ENAMETOOLONG 1420 A component of a pathname exceeded 255 characters, or an entire 1421 path name exceeded 1023 characters. 1422 1423 @item ENOENT 1424 The named file does not exist. 1425 1426 @item EACCES 1427 The named file is not writable by the user. 1428 1429 @item EACCES 1430 Search permission is denied for a component of the path prefix. 1431 1432 @item ELOOP 1433 Too many symbolic links were encountered in translating the 1434 pathname 1435 1436 @item EISDIR 1437 The named file is a directory. 1438 1439 @item EROFS 1440 The named file resides on a read-only file system 1441 1442 @item ETXTBSY 1443 The file is a pure procedure (shared text) file that is being 1444 executed 1445 1446 @item EIO 1447 An I/O error occurred updating the inode. 1448 1449 @item EFAULT 1450 @code{Path} points outside the process's allocated address space. 1451 1452 @item EBADF 1453 The @code{fd} is not a valid descriptor. 1454 1455 @end table 1456 1457 @subheading DESCRIPTION: 1458 1459 2code{Truncate} causes the file named by @code{path} or referenced by 1460 @code{fd} to be truncated to at most @code{length} bytes in size. If the 1461 file previously was larger than this size, the extra data is lost. With 1462 @code{ftruncate}, the file must be open for writing. 1463 1464 @subheading NOTES: None 1400 1465 1401 1466 @page … … 1408 1473 #include <unistd.h> 1409 1474 1410 int pathconf(const char *path, 1411 int name 1475 int pathconf( 1476 const char *path, 1477 int name 1412 1478 ); 1413 1479 @end example … … 1422 1488 @item EINVAL 1423 1489 Invalid argument 1490 1424 1491 @item EACCES 1425 1492 Permission to write the file is denied 1493 1426 1494 @item ENAMETOOLONG 1427 1495 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC 1428 1496 is in effect. 1497 1429 1498 @item ENOENT 1430 1499 A file or directory does not exist 1500 1431 1501 @item ENOTDIR 1432 1502 A component of the specified @code{path} was not a directory whan a … … 1443 1513 1444 1514 @table @b 1445 @item _PC_LINK_MAX1515 @item _PC_LINK_MAX 1446 1516 returns the maximum number of links to the file. If @code{filedes} or 1447 1517 @code{path} refer to a directory, then the value applies to the whole 1448 1518 directory. The corresponding macro is _POSIX_LINK_MAX. 1449 1519 1450 @item _PC_MAX_CANON1520 @item _PC_MAX_CANON 1451 1521 returns the maximum length of a formatted input line, where @code{filedes} 1452 1522 or @code{path} must refer to a terminal. The corresponding macro is 1453 1523 _POSIX_MAX_CANON. 1454 1524 1455 @item _PC_MAX_INPUT1525 @item _PC_MAX_INPUT 1456 1526 returns the maximum length of an input line, where @code{filedes} or 1457 1527 @code{path} must refer to a terminal. The corresponding macro is 1458 1528 _POSIX_MAX_INPUT. 1459 1529 1460 @item _PC_NAME_MAX1530 @item _PC_NAME_MAX 1461 1531 returns the maximum length of a filename in the directory @code{path} or 1462 1532 @code{filedes}. The process is allowed to create. The corresponding macro 1463 1533 is _POSIX_NAME_MAX. 1464 1534 1465 @item _PC_PATH_MAX1535 @item _PC_PATH_MAX 1466 1536 returns the maximum length of a relative pathname when @code{path} or 1467 1537 @code{filedes} is the current working directory. The corresponding macro 1468 1538 is _POSIX_PATH_MAX. 1469 1539 1470 @item _PC_PIPE_BUF1540 @item _PC_PIPE_BUF 1471 1541 returns the size of the pipe buffer, where @code{filedes} must refer to a 1472 1542 pipe or FIFO and @code{path} must refer to a FIFO. The corresponding macro 1473 1543 is _POSIX_PIPE_BUF. 1474 1544 1475 @item _PC_CHOWN_RESTRICTED1545 @item _PC_CHOWN_RESTRICTED 1476 1546 returns nonzero if the chown(2) call may not be used on this file. If 1477 1547 @code{filedes} or @code{path} refer to a directory, then this applies to all … … 1494 1564 #include <unistd.h> 1495 1565 1496 int fpathconf(int filedes, 1497 int name 1566 int fpathconf( 1567 int filedes, 1568 int name 1498 1569 ); 1499 1570 @end example … … 1508 1579 @item EINVAL 1509 1580 Invalid argument 1581 1510 1582 @item EACCES 1511 1583 Permission to write the file is denied 1512 1584 @item ENAMETOOLONG 1585 1513 1586 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC 1514 1587 is in effect. 1588 1515 1589 @item ENOENT 1516 1590 A file or directory does not exist 1591 1517 1592 @item ENOTDIR 1518 1593 A component of the specified @code{path} was not a directory whan a 1519 1594 directory was expected. 1595 1520 1596 @end table 1521 1597 … … 1529 1605 1530 1606 @table @b 1531 @item _PC_LINK_MAX1607 @item _PC_LINK_MAX 1532 1608 returns the maximum number of links to the file. If @code{filedes} or 1533 1609 @code{path} refer to a directory, then the value applies to the whole 1534 1610 directory. The corresponding macro is _POSIX_LINK_MAX. 1535 1611 1536 @item _PC_MAX_CANON1612 @item _PC_MAX_CANON 1537 1613 returns the maximum length of a formatted input line, where @code{filedes} 1538 1614 or @code{path} must refer to a terminal. The corresponding macro is 1539 1615 _POSIX_MAX_CANON. 1540 1616 1541 @item _PC_MAX_INPUT1617 @item _PC_MAX_INPUT 1542 1618 returns the maximum length of an input line, where @code{filedes} or 1543 1619 @code{path} must refer to a terminal. The corresponding macro is 1544 1620 _POSIX_MAX_INPUT. 1545 1621 1546 @item _PC_NAME_MAX1622 @item _PC_NAME_MAX 1547 1623 returns the maximum length of a filename in the directory @code{path} or 1548 1624 @code{filedes}. The process is allowed to create. The corresponding macro 1549 1625 is _POSIX_NAME_MAX. 1550 1626 1551 @item _PC_PATH_MAX1627 @item _PC_PATH_MAX 1552 1628 returns the maximum length of a relative pathname when @code{path} or 1553 1629 @code{filedes} is the current working directory. The corresponding macro 1554 1630 is _POSIX_PATH_MAX. 1555 1631 1556 @item _PC_PIPE_BUF1632 @item _PC_PIPE_BUF 1557 1633 returns the size of the pipe buffer, where @code{filedes} must refer to a 1558 1634 pipe or FIFO and @code{path} must refer to a FIFO. The corresponding macro 1559 1635 is _POSIX_PIPE_BUF. 1560 1636 1561 @item _PC_CHOWN_RESTRICTED1562 returns nonzero if the chown(2)call may not be used on this file. If1637 @item _PC_CHOWN_RESTRICTED 1638 returns nonzero if the @code{chown()} call may not be used on this file. If 1563 1639 @code{filedes} or @code{path} refer to a directory, then this applies to all 1564 1640 files in that directory. The corresponding macro is _POSIX_CHOWN_RESTRICTED. … … 1566 1642 @end table 1567 1643 1568 1569 @subheading NOTES: 1570 1644 @subheading NOTES: 1645 1646 NONE
Note: See TracChangeset
for help on using the changeset viewer.