From cb2898bace89b16b4deae484375513c12a2d3b47 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 14 Sep 2008 05:22:19 +0000 Subject: * interp/sys-os.boot (readablep): Import. (writeablep): Document. * algebra/fname.spad.pamphlet (exists?$FileName): Use existingFile? (readable?$FileName): Use readablep. (writeable?$FileName): Use writeable. --- src/interp/sys-os.boot | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/interp') diff --git a/src/interp/sys-os.boot b/src/interp/sys-os.boot index 3d3ecc6d..3ab992a8 100644 --- a/src/interp/sys-os.boot +++ b/src/interp/sys-os.boot @@ -45,6 +45,8 @@ module sys_-os loadSystemRuntimeCore() +--% File System Support + ++ change current working directory. import oa__chdir: string -> int for changeDirectory -- 0: success, -1: failure @@ -61,6 +63,22 @@ import oa__rename: (string,string) -> int for renameFile import oa__mkdir: string -> int for mkdir -- 0: sucess, -1: failure. +++ Test whether a path names a directory. +import directoryp: string -> int for directoryp + +++ Test whether a file exists and is accessible for read. +import readablep: string -> int for readablep + -- -1: inexistent. + -- 0: exist but read access denied. + -- 1: exist and read accress granted. + +++ Test whether a file exists and is accessible for write. +import writeablep: string -> int for writeablep + -- -1: inexistent. + -- 0: exists but write access denied + -- 1: exists and write access granted + -- 2: inexistent but write access to parent directory granted. + import oa__filedesc__read: (int,buffer,int) -> int for readFromFileHandle -- -1: failure; otherwise -- actual read bytes count @@ -124,10 +142,6 @@ import sock__send__signal: (int,int) -> int for sockSendSignal import print__line: string -> int for printLine --% -import directoryp: string -> int for directoryp - - -import writeablep: string -> int for writeablep import oa__system: string -> int for runCommand -- cgit v1.2.3