1 signature POSIX_FILE_SYS =
7 val fdToWord: file_desc -> SysWord.word
8 val wordToFD: SysWord.word -> file_desc
10 (* identity functions *)
11 val fdToIOD: file_desc -> OS.IO.iodesc
12 val iodToFD: OS.IO.iodesc -> file_desc option
15 val opendir: string -> dirstream
16 val readdir: dirstream -> string option
17 val rewinddir: dirstream -> unit
18 val closedir: dirstream -> unit
20 val chdir: string -> unit
21 val getcwd: unit -> string
30 include BIT_FLAGS where type flags = mode
60 datatype open_mode = O_RDONLY | O_WRONLY | O_RDWR
62 val openf: string * open_mode * O.flags -> file_desc
63 val createf: string * open_mode * O.flags * S.mode -> file_desc
64 val creat: string * S.mode -> file_desc
65 val umask: S.mode -> S.mode
66 val link: {old: string, new: string} -> unit
67 val mkdir: string * S.mode -> unit
68 val mkfifo: string * S.mode -> unit
69 val unlink: string -> unit
70 val rmdir: string -> unit
71 val rename: {old: string, new: string} -> unit
72 val symlink: {old: string, new: string} -> unit
73 val readlink: string -> string
76 val wordToDev: SysWord.word -> dev
77 val devToWord: dev -> SysWord.word
80 val wordToIno: SysWord.word -> ino
81 val inoToWord: ino -> SysWord.word
87 val isDir: stat -> bool
88 val isChr: stat -> bool
89 val isBlk: stat -> bool
90 val isReg: stat -> bool
91 val isFIFO: stat -> bool
92 val isLink: stat -> bool
93 val isSock: stat -> bool
94 val mode: stat -> S.mode
97 val nlink: stat -> int
100 val size: stat -> Position.int
101 val atime: stat -> Time.time
102 val mtime: stat -> Time.time
103 val ctime: stat -> Time.time
106 val stat: string -> ST.stat
107 val lstat: string -> ST.stat
108 val fstat: file_desc -> ST.stat
110 datatype access_mode = A_READ | A_WRITE | A_EXEC
112 val access: string * access_mode list -> bool
113 val chmod: string * S.mode -> unit
114 val fchmod: file_desc * S.mode -> unit
115 val chown: string * uid * gid -> unit
116 val fchown: file_desc * uid * gid -> unit
117 val utime: string * {actime: Time.time, modtime: Time.time} option -> unit
118 val ftruncate: file_desc * Position.int -> unit
119 val pathconf: string * string -> SysWord.word option
120 val fpathconf: file_desc * string -> SysWord.word option
123 signature POSIX_FILE_SYS_EXTRA =
125 include POSIX_FILE_SYS
127 val flagsToOpenMode: O.flags -> open_mode