Changeset 389c3e9 in rtems
- Timestamp:
- 09/26/98 19:33:58 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- e21f7d8
- Parents:
- 64183e20
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/new_chapters/files.t
r64183e20 r389c3e9 19 19 @item @code{readdir} - Reads a directory 20 20 @item @code{readdir_r} - 21 @item @code{rewinddir} - 21 @item @code{rewinddir} - Resets the @code{readdir()} pointer 22 22 @item @code{scandir} - Scan a directory for matching entries 23 @item @code{telldir} - 24 @item @code{closedir} - 25 @item @code{getdents} 23 @item @code{telldir} - Return current location in directory stream 24 @item @code{closedir} - Ends directory read operation 25 @item @code{getdents} - Get directory entries 26 26 @item @code{chdir} - Changes the current working directory 27 27 @item @code{getcwd} - Gets current working directory … … 31 31 @item @code{link} - Creates a link to a file 32 32 @item @code{mkdir} - Makes a directory 33 @item @code{mkfifo} - 33 @item @code{mkfifo} - Makes a FIFO special file 34 34 @item @code{unlink} - Removes a directory entry 35 35 @item @code{rmdir} - Delete a directory 36 36 @item @code{rename} - Renames a file 37 37 @item @code{stat} - Gets information about a file. 38 @item @code{fstat} - 38 @item @code{fstat} - Gets file status 39 39 @item @code{access} - Check user's permissions for a file. 40 40 @item @code{chmod} - Changes file mode 41 @item @code{fchmod} - 41 @item @code{fchmod} - Changes permissions of a file 42 42 @item @code{chown} - Changes the owner and/ or group of a file 43 43 @item @code{utime} - Change access and/or modification times of an inode 44 44 @item @code{ftrunctate} - 45 @item @code{pathconf} - 46 @item @code{fpathconf} - 45 @item @code{pathconf} - Gets configuration values for files 46 @item @code{fpathconf} - Get configuration values for files 47 47 @end itemize 48 48 … … 178 178 179 179 @page 180 @subsection rewinddir - 181 182 @subheading CALLING SEQUENCE: 183 184 @ifset is-C 185 @example 186 int rewinddir( 187 ); 188 @end example 189 @end ifset 190 191 @ifset is-Ada 192 @end ifset 193 194 @subheading STATUS CODES: 195 196 @table @b 197 @item E 198 The 199 200 @end table 201 202 @subheading DESCRIPTION: 203 204 @subheading NOTES: 180 @subsection rewinddir - Resets the @code{readdir()} pointer 181 182 @subheading CALLING SEQUENCE: 183 184 @ifset is-C 185 @example 186 #include <sys/types.h> 187 #include <dirent.h> 188 189 void rewinddir(DIR *dirp 190 ); 191 @end example 192 @end ifset 193 194 @ifset is-Ada 195 @end ifset 196 197 @subheading STATUS CODES: No value is returned. 198 199 @subheading DESCRIPTION: 200 201 The @code{rewinddir()} function resets the position associated with 202 the directory stream pointed to by @code{dirp}. It also causes the 203 directory stream to refer to the current state of the directory. 204 205 @subheading NOTES: 206 207 If @code{dirp} is not a pointer by @code{opendir()}, the results are 208 undefined. 205 209 206 210 The routine is implemented in Cygnus newlib. … … 248 252 249 253 @page 250 @subsection telldir - 251 252 @subheading CALLING SEQUENCE: 253 254 @ifset is-C 255 @example 256 int telldir( 257 ); 258 @end example 259 @end ifset 260 261 @ifset is-Ada 262 @end ifset 263 264 @subheading STATUS CODES: 265 266 @table @b 267 @item E 268 The 269 270 @end table 271 272 @subheading DESCRIPTION: 254 @subsection telldir - Return current location in directory stream 255 256 @subheading CALLING SEQUENCE: 257 258 @ifset is-C 259 @example 260 #include <dirent.h> 261 262 off_t telldir( DIR *dir 263 ); 264 @end example 265 @end ifset 266 267 @ifset is-Ada 268 @end ifset 269 270 @subheading STATUS CODES: 271 272 @table @b 273 @item EBADF 274 Invalid directory stream descriptor @code{dir}. 275 276 @end table 277 278 @subheading DESCRIPTION: 279 280 The @code{telldir()} function returns the current location associated with the 281 directory stream @code{dir}. 273 282 274 283 @subheading NOTES: … … 278 287 279 288 @page 280 @subsection closedir - 281 282 @subheading CALLING SEQUENCE: 283 284 @ifset is-C 285 @example 286 int closedir( 287 ); 288 @end example 289 @end ifset 290 291 @ifset is-Ada 292 @end ifset 293 294 @subheading STATUS CODES: 295 296 @table @b 297 @item E 298 The 299 300 @end table 301 302 @subheading DESCRIPTION: 303 304 @subheading NOTES: 289 @subsection closedir - Ends directory read operation 290 291 @subheading CALLING SEQUENCE: 292 293 @ifset is-C 294 @example 295 #include <sys/types.h> 296 #include <dirent.h> 297 298 int closedir(DIR *dirp 299 ); 300 @end example 301 @end ifset 302 303 @ifset is-Ada 304 @end ifset 305 306 @subheading STATUS CODES: 307 308 @table @b 309 @item EBADF 310 Invalid file descriptor 311 312 @end table 313 314 @subheading DESCRIPTION: 315 316 The directory stream associated with @code{dirp} is closed. 317 The value in @code{dirp} may not be usable after a call to 318 @code{closedir()}. 319 320 @subheading NOTES: 321 322 The argument to @code{closedir()} must be a pointer returned by 323 @code{opendir()}. If it is not, the results are not portable and 324 most likely unpleasant. 305 325 306 326 The routine is implemented in Cygnus newlib. … … 740 760 741 761 @page 742 @subsection mkfifo - 743 744 @subheading CALLING SEQUENCE: 745 746 @ifset is-C 747 @example 748 int mkfifo( 749 ); 750 @end example 751 @end ifset 752 753 @ifset is-Ada 754 @end ifset 755 756 @subheading STATUS CODES: 757 758 @table @b 759 @item E 760 The 761 762 @end table 763 764 @subheading DESCRIPTION: 765 766 @subheading NOTES: 762 @subsection mkfifo - Makes a FIFO special file 763 764 @subheading CALLING SEQUENCE: 765 766 @ifset is-C 767 @example 768 #include <sys/types.h> 769 #include <sys/stat.h> 770 771 772 int mkfifo(const char *path, 773 mode_t mode 774 ); 775 @end example 776 @end ifset 777 778 @ifset is-Ada 779 @end ifset 780 781 @subheading STATUS CODES: 782 783 @table @b 784 @item EACCES 785 Search permission is denied for a directory in a file's path prefix 786 @item EEXIST 787 The named file already exists. 788 @item ENOENT 789 A file or directory does not exist. 790 @item ENOSPC 791 No space left on disk. 792 @item ENOTDIR 793 A component of the specified @code{path} was not a directory when a directory 794 was expected. 795 @item EROFS 796 Read-only file system. 797 798 @end table 799 800 @subheading DESCRIPTION: 801 802 The @code{mkfifo()} function creates a new FIFO special file named @code{path}. 803 The permission bits (modified by the file creation mask) are set from 804 @code{mode}. The owner and group IDs for the FIFO are set from the efective 805 user ID and group ID. 806 807 @subheading NOTES: None 767 808 768 809 @page … … 797 838 A file or directory does not exist. 798 839 @item ENOTDIR 799 A component of the specified pathnamewas not a directory when a directory840 A component of the specified @code{path} was not a directory when a directory 800 841 was expected. 801 842 @item EPERM … … 1003 1044 1004 1045 @page 1005 @subsection fstat - 1006 1007 @subheading CALLING SEQUENCE: 1008 1009 @ifset is-C 1010 @example 1011 int fstat( 1012 ); 1013 @end example 1014 @end ifset 1015 1016 @ifset is-Ada 1017 @end ifset 1018 1019 @subheading STATUS CODES: 1020 1021 @table @b 1022 @item E 1023 The 1024 1025 @end table 1026 1027 @subheading DESCRIPTION: 1046 @subsection fstat - Gets file status 1047 1048 @subheading CALLING SEQUENCE: 1049 1050 @ifset is-C 1051 @example 1052 #include <sys/types.h> 1053 #include <sys/stat.h> 1054 1055 int fstat(int fildes, 1056 struct stat *buf 1057 ); 1058 @end example 1059 @end ifset 1060 1061 @ifset is-Ada 1062 @end ifset 1063 1064 @subheading STATUS CODES: 1065 1066 @table @b 1067 @item EBADF 1068 Invalid file descriptor 1069 1070 @end table 1071 1072 @subheading DESCRIPTION: 1073 1074 The @code{fstat()} function obtains information about the file 1075 associated with @code{fildes} and writes it to the area pointed 1076 to by the @code{buf} argument. 1028 1077 1029 1078 @subheading NOTES: … … 1133 1182 1134 1183 @page 1135 @subsection fchmod - 1136 1137 @subheading CALLING SEQUENCE: 1138 1139 @ifset is-C 1140 @example 1141 int fchmod( 1184 @subsection fchmod - Changes permissions of a file 1185 1186 @subheading CALLING SEQUENCE: 1187 1188 @ifset is-C 1189 @example 1190 #include <sys/types.h> 1191 #include <sys/stat.h> 1192 1193 int fchmod(int fildes, 1194 mote_t mode 1195 ); 1196 @end example 1197 @end ifset 1198 1199 @ifset is-Ada 1200 @end ifset 1201 1202 @subheading STATUS CODES: 1203 1204 @table @b 1205 @item EACCES 1206 Search permission is denied for a directory in a file's path prefix. 1207 @item EBADF 1208 The descriptor is not valid. 1209 @item EFAULT 1210 @code{Path} points outside your accessible address space. 1211 @item EIO 1212 A low-level I/o error occurred while modifying the inode. 1213 @item ELOOP 1214 @code{Path} contains a circular reference 1215 @item ENAMETOOLONG 1216 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is 1217 in effect. 1218 @item ENOENT 1219 A file or directory does no exist. 1220 @item ENOMEM 1221 Insufficient kernel memory was avaliable. 1222 @item ENOTDIR 1223 A component of the specified pathname was not a directory when a 1224 directory was expected. 1225 @item EPERM 1226 The effective UID does not match the owner of the file, and is not 1227 zero 1228 @item EROFS 1229 Read-only file system 1230 @end table 1231 1232 @subheading DESCRIPTION: 1233 1234 The mode of the file given by @code{path} or referenced by 1235 @code{filedes} is changed. 1236 1237 @subheading NOTES: None 1238 1239 @page 1240 @subsection getdents - Get directory entries 1241 1242 @subheading CALLING SEQUENCE: 1243 1244 @ifset is-C 1245 @example 1246 #include <unistd.h> 1247 #include <linux/dirent.h> 1248 #include <linux/unistd.h> 1249 1250 long getdents(int dd_fd, 1251 char *dd_buf, 1252 int dd_len 1142 1253 ); 1143 1254 @end example … … 1289 1400 1290 1401 @page 1291 @subsection pathconf - 1292 1293 @subheading CALLING SEQUENCE: 1294 1295 @ifset is-C 1296 @example 1297 int pathconf( 1298 ); 1299 @end example 1300 @end ifset 1301 1302 @ifset is-Ada 1303 @end ifset 1304 1305 @subheading STATUS CODES: 1306 1307 @table @b 1308 @item E 1309 The 1310 1311 @end table 1312 1313 @subheading DESCRIPTION: 1314 1315 @subheading NOTES: 1316 1317 @page 1318 @subsection fpathconf - 1319 1320 @subheading CALLING SEQUENCE: 1321 1322 @ifset is-C 1323 @example 1324 int fpathconf( 1325 ); 1326 @end example 1327 @end ifset 1328 1329 @ifset is-Ada 1330 @end ifset 1331 1332 @subheading STATUS CODES: 1333 1334 @table @b 1335 @item E 1336 The 1337 1338 @end table 1339 1340 @subheading DESCRIPTION: 1341 1342 @subheading NOTES: 1343 1402 @subsection pathconf - Gets configuration values for files 1403 1404 @subheading CALLING SEQUENCE: 1405 1406 @ifset is-C 1407 @example 1408 #include <unistd.h> 1409 1410 int pathconf(const char *path, 1411 int name 1412 ); 1413 @end example 1414 @end ifset 1415 1416 @ifset is-Ada 1417 @end ifset 1418 1419 @subheading STATUS CODES: 1420 1421 @table @b 1422 @item EINVAL 1423 Invalid argument 1424 @item EACCES 1425 Permission to write the file is denied 1426 @item ENAMETOOLONG 1427 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC 1428 is in effect. 1429 @item ENOENT 1430 A file or directory does not exist 1431 @item ENOTDIR 1432 A component of the specified @code{path} was not a directory whan a 1433 directory was expected. 1434 1435 @end table 1436 1437 @subheading DESCRIPTION: 1438 1439 @code{pathconf()} gets a value for the configuration option @code{name} 1440 for the open file descriptor @code{filedes}. 1441 1442 The possible values for name are: 1443 1444 @table @b 1445 @item_PC_LINK_MAX 1446 returns the maximum number of links to the file. If @code{filedes} or 1447 @code{path} refer to a directory, then the value applies to the whole 1448 directory. The corresponding macro is _POSIX_LINK_MAX. 1449 1450 @item_PC_MAX_CANON 1451 returns the maximum length of a formatted input line, where @code{filedes} 1452 or @code{path} must refer to a terminal. The corresponding macro is 1453 _POSIX_MAX_CANON. 1454 1455 @item_PC_MAX_INPUT 1456 returns the maximum length of an input line, where @code{filedes} or 1457 @code{path} must refer to a terminal. The corresponding macro is 1458 _POSIX_MAX_INPUT. 1459 1460 @item_PC_NAME_MAX 1461 returns the maximum length of a filename in the directory @code{path} or 1462 @code{filedes}. The process is allowed to create. The corresponding macro 1463 is _POSIX_NAME_MAX. 1464 1465 @item_PC_PATH_MAX 1466 returns the maximum length of a relative pathname when @code{path} or 1467 @code{filedes} is the current working directory. The corresponding macro 1468 is _POSIX_PATH_MAX. 1469 1470 @item_PC_PIPE_BUF 1471 returns the size of the pipe buffer, where @code{filedes} must refer to a 1472 pipe or FIFO and @code{path} must refer to a FIFO. The corresponding macro 1473 is _POSIX_PIPE_BUF. 1474 1475 @item_PC_CHOWN_RESTRICTED 1476 returns nonzero if the chown(2) call may not be used on this file. If 1477 @code{filedes} or @code{path} refer to a directory, then this applies to all 1478 files in that directory. The corresponding macro is _POSIX_CHOWN_RESTRICTED. 1479 1480 @end table 1481 1482 @subheading NOTES: 1483 1484 Files with name lengths longer than the value returned for @code{name} equal 1485 _PC_NAME_MAX may exist in the given directory. 1486 1487 @page 1488 @subsection fpathconf - Gets configuration values for files 1489 1490 @subheading CALLING SEQUENCE: 1491 1492 @ifset is-C 1493 @example 1494 #include <unistd.h> 1495 1496 int fpathconf(int filedes, 1497 int name 1498 ); 1499 @end example 1500 @end ifset 1501 1502 @ifset is-Ada 1503 @end ifset 1504 1505 @subheading STATUS CODES: 1506 1507 @table @b 1508 @item EINVAL 1509 Invalid argument 1510 @item EACCES 1511 Permission to write the file is denied 1512 @item ENAMETOOLONG 1513 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC 1514 is in effect. 1515 @item ENOENT 1516 A file or directory does not exist 1517 @item ENOTDIR 1518 A component of the specified @code{path} was not a directory whan a 1519 directory was expected. 1520 @end table 1521 1522 1523 @subheading DESCRIPTION: 1524 1525 @code{pathconf()} gets a value for the configuration option @code{name} 1526 for the open file descriptor @code{filedes}. 1527 1528 The possible values for name are: 1529 1530 @table @b 1531 @item_PC_LINK_MAX 1532 returns the maximum number of links to the file. If @code{filedes} or 1533 @code{path} refer to a directory, then the value applies to the whole 1534 directory. The corresponding macro is _POSIX_LINK_MAX. 1535 1536 @item_PC_MAX_CANON 1537 returns the maximum length of a formatted input line, where @code{filedes} 1538 or @code{path} must refer to a terminal. The corresponding macro is 1539 _POSIX_MAX_CANON. 1540 1541 @item_PC_MAX_INPUT 1542 returns the maximum length of an input line, where @code{filedes} or 1543 @code{path} must refer to a terminal. The corresponding macro is 1544 _POSIX_MAX_INPUT. 1545 1546 @item_PC_NAME_MAX 1547 returns the maximum length of a filename in the directory @code{path} or 1548 @code{filedes}. The process is allowed to create. The corresponding macro 1549 is _POSIX_NAME_MAX. 1550 1551 @item_PC_PATH_MAX 1552 returns the maximum length of a relative pathname when @code{path} or 1553 @code{filedes} is the current working directory. The corresponding macro 1554 is _POSIX_PATH_MAX. 1555 1556 @item_PC_PIPE_BUF 1557 returns the size of the pipe buffer, where @code{filedes} must refer to a 1558 pipe or FIFO and @code{path} must refer to a FIFO. The corresponding macro 1559 is _POSIX_PIPE_BUF. 1560 1561 @item_PC_CHOWN_RESTRICTED 1562 returns nonzero if the chown(2) call may not be used on this file. If 1563 @code{filedes} or @code{path} refer to a directory, then this applies to all 1564 files in that directory. The corresponding macro is _POSIX_CHOWN_RESTRICTED. 1565 1566 @end table 1567 1568 1569 @subheading NOTES: 1570
Note: See TracChangeset
for help on using the changeset viewer.