source: rtems-docs/posix1003_1/files_and_directories.rst @ 9aafb39

4.115
Last change on this file since 9aafb39 was 489740f, checked in by Chris Johns <chrisj@…>, on 05/20/16 at 02:47:09

Set SPDX License Identifier in each source file.

  • Property mode set to 100644
File size: 5.2 KB
Line 
1.. comment SPDX-License-Identifier: CC-BY-SA-4.0
2
3Files and Directories
4#####################
5
6Directories
7===========
8
9Format of Directory Entries
10---------------------------
11
12Directory Operations
13--------------------
14
15.. code:: c
16
17    struct dirent, Type, Implemented
18    opendir(), Function, Implemented
19    readdir(), Function, Implemented
20    readdir_r(), Function, Implemented
21    rewinddir(), Function, Implemented
22    closedir(), Function, Implemented
23
24Working Directory
25=================
26
27Change Current Working Directory
28--------------------------------
29
30.. code:: c
31
32    chdir(), Function, Implemented
33
34Get Working Directory Pathname
35------------------------------
36
37.. code:: c
38
39    getcwd(), Function, Implemented
40
41General File Creation
42=====================
43
44Open a File
45-----------
46
47.. code:: c
48
49    open(), Function, Implemented
50    O_RDONLY, Constant, Implemented
51    O_WRONLY, Constant, Implemented
52    O_RDWR, Constant, Implemented
53    O_APPEND, Constant, Implemented
54    O_CREAT, Constant, Implemented
55    O_DSYNC, Constant, Unimplemented
56    O_EXCL, Constant, Implemented
57    O_NOCTTY, Constant, Implemented
58    O_NONBLOCK, Constant, Implemented
59    O_RSYNC, Constant, Unimplemented
60    O_SYNC, Constant, Implemented
61    O_TRUNC, Constant, Implemented
62
63NOTE: In the newlib fcntl.h, O_SYNC is defined only if _POSIX_SOURCE is
64not defined.  This seems wrong.
65
66Create a New File or Rewrite an Existing One
67--------------------------------------------
68
69.. code:: c
70
71    creat(), Function, Implemented
72
73Set File Creation Mask
74----------------------
75
76.. code:: c
77
78    umask(), Function, Implemented
79
80Link to a File
81--------------
82
83.. code:: c
84
85    link(), Function, Implemented
86
87Special File Creation
88=====================
89
90Make a Directory
91----------------
92
93.. code:: c
94
95    mkdir(), Function, Implemented
96
97Make a FIFO Special File
98------------------------
99
100.. code:: c
101
102    mkfifo(), Function, Untested Implementation
103
104NOTE: mkfifo() is implemented but no filesystem supports FIFOs.
105
106File Removal
107============
108
109Remove Directory Entries
110------------------------
111
112.. code:: c
113
114    unlink(), Function, Implemented
115
116Remove a Directory
117------------------
118
119.. code:: c
120
121    rmdir(), Function, Implemented
122
123Rename a File
124-------------
125
126.. code:: c
127
128    rename(), Function, Partial Implementation
129
130File Characteristics
131====================
132
133File Characteristics Header and Data Structure
134----------------------------------------------
135
136.. code:: c
137
138    struct stat, Type, Implemented
139
140<sys/stat.h> File Types
141~~~~~~~~~~~~~~~~~~~~~~~
142
143.. code:: c
144
145    S_ISBLK(), Function, Implemented
146    S_ISCHR(), Function, Implemented
147    S_ISDIR(), Function, Implemented
148    S_ISFIFO(), Function, Implemented
149    S_ISREG(), Function, Implemented
150    S_TYPEISMQ(), Function, Unimplemented
151    S_TYPEISSEM(), Function, Unimplemented
152    S_TYPEISSHM(), Function, Unimplemented
153
154<sys/stat.h> File Modes
155~~~~~~~~~~~~~~~~~~~~~~~
156
157.. code:: c
158
159    S_IRWXU, Constant, Implemented
160    S_IRUSR, Constant, Implemented
161    S_IWUSR, Constant, Implemented
162    S_IXUSR, Constant, Implemented
163    S_IRWXG, Constant, Implemented
164    S_IRGRP, Constant, Implemented
165    S_IWGRP, Constant, Implemented
166    S_IXGRP, Constant, Implemented
167    S_IRWXO, Constant, Implemented
168    S_IROTH, Constant, Implemented
169    S_IWOTH, Constant, Implemented
170    S_IXOTH, Constant, Implemented
171    S_ISUID, Constant, Implemented
172    S_ISGID, Constant, Implemented
173
174<sys/stat.h> Time Entries
175~~~~~~~~~~~~~~~~~~~~~~~~~
176
177Get File Status
178---------------
179
180.. code:: c
181
182    stat(), Function, Implemented
183    fstat(), Function, Implemented
184
185Check File Accessibility
186------------------------
187
188.. code:: c
189
190    access(), Function, Implemented
191
192Change File Modes
193-----------------
194
195.. code:: c
196
197    chmod(), Function, Implemented
198    fchmod(), Function, Implemented
199
200Change Owner and Group of a File
201--------------------------------
202
203.. code:: c
204
205    chown(), Function, Implemented
206
207Set File Access and Modification Times
208--------------------------------------
209
210.. code:: c
211
212    struct utimbuf, Type, Implemented
213    utime(), Function, Implemented
214
215Truncate a File to a Specified Length
216-------------------------------------
217
218.. code:: c
219
220    ftruncate(), Function, Implemented
221
222Configurable Pathname Variable
223==============================
224
225Get Configurable Pathname Variables
226-----------------------------------
227
228.. code:: c
229
230    pathconf(), Function, Implemented
231    fpathconf(), Function, Implemented
232    _PC_LINK_MAX, Constant, Implemented
233    _PC_MAX_CANON, Constant, Implemented
234    _PC_MAX_INPUT, Constant, Implemented
235    _PC_MAX_INPUT, Constant, Implemented
236    _PC_NAME_MAX, Constant, Implemented
237    _PC_PATH_MAX, Constant, Implemented
238    _PC_PIPE_BUF, Constant, Implemented
239    _PC_ASYNC_IO, Constant, Implemented
240    _PC_CHOWN_RESTRICTED, Constant, Implemented
241    _PC_NO_TRUNC, Constant, Implemented
242    _PC_PRIO_IO, Constant, Implemented
243    _PC_SYNC_IO, Constant, Implemented
244    _PC_VDISABLE, Constant, Implemented
245
246NOTE: The newlib unistd.h and sys/unistd.h are installed and the
247include search patch is used to get the right one.  There are
248conflicts between the newlib unistd.h and RTEMS' version.
249
250.. COMMENT: COPYRIGHT (c) 1988-2002.
251
252.. COMMENT: On-Line Applications Research Corporation (OAR).
253
254.. COMMENT: All rights reserved.
255
Note: See TracBrowser for help on using the repository browser.