SCM Repository
[smlnj] Diff of /smlnj-lib/branches/rt-transition/Unix/unix-path.sml
Diff of /smlnj-lib/branches/rt-transition/Unix/unix-path.sml
Parent Directory
|
Revision Log
|
Patch
26 |
end (* getPath *) |
end (* getPath *) |
27 |
|
|
28 |
local |
local |
29 |
|
(* Workaround for new runtime until we have the Posix APIs implemented *) |
30 |
|
structure FS = OS.FileSys |
31 |
|
fun isFileTy (path, F_REGULAR) = not(FS.isDir orelse FS.isLink) |
32 |
|
| isFileTy (path, F_DIR) = FS.isDir path |
33 |
|
| isFileTy (path, F_SYMLINK) = FS.isLink path |
34 |
|
| isFileTy (path, _) = raise Fail "unimplemented" |
35 |
|
(* |
36 |
structure ST = Posix.FileSys.ST |
structure ST = Posix.FileSys.ST |
37 |
fun isFileTy (path, ty) = let |
fun isFileTy (path, ty) = let |
38 |
val st = Posix.FileSys.stat path |
val st = Posix.FileSys.stat path |
46 |
| F_BLK => ST.isBlk st |
| F_BLK => ST.isBlk st |
47 |
(* end case *) |
(* end case *) |
48 |
end |
end |
49 |
|
*) |
50 |
fun access mode pathname = (OS.FileSys.access(pathname, mode)) |
fun access mode pathname = (OS.FileSys.access(pathname, mode)) |
51 |
fun accessAndType (mode, ftype) pathname = ( |
fun accessAndType (mode, ftype) pathname = ( |
52 |
OS.FileSys.access(pathname, mode) |
OS.FileSys.access(pathname, mode) |
|
Legend:
Removed from v.2980 |
|
changed lines |
|
Added in v.2981 |
|
|