aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/interp/database.boot4
-rw-r--r--src/interp/i-syscmd.boot10
-rw-r--r--src/interp/lisplib.boot4
-rw-r--r--src/interp/nlib.lisp3
-rw-r--r--src/interp/sys-os.boot5
-rw-r--r--src/interp/sys-utility.boot8
-rw-r--r--src/interp/word.boot2
8 files changed, 23 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index decb8b17..14cc692a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
2013-05-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
+ * interp/sys-utility.boot ($ERASE): Remove.
+
+2013-05-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
* interp/nlib.lisp ($FINDFILE): Move to sys-utility.boot.
2013-05-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
diff --git a/src/interp/database.boot b/src/interp/database.boot
index d63d0f44..d96fba4a 100644
--- a/src/interp/database.boot
+++ b/src/interp/database.boot
@@ -313,14 +313,14 @@ buildDatabase(filemode,expensive) ==
buildGloss()
saveUsersHashTable() ==
- _$ERASE('USERS,'DATABASE,'a)
+ removeFile makeFullFilePath ['USERS,'DATABASE,'a]
stream:= writeLib1('USERS,'DATABASE,'a)
for k in MSORT HKEYS $usersTb repeat
rwrite(k, tableValue($usersTb, k), stream)
RSHUT stream
saveDependentsHashTable() ==
- _$ERASE('DEPENDENTS,'DATABASE,'a)
+ removeFile makeFullFilePath ['DEPENDENTS,'DATABASE,'a]
stream:= writeLib1('DEPENDENTS,'DATABASE,'a)
for k in MSORT HKEYS $depTb repeat
rwrite(k, tableValue($depTb, k), stream)
diff --git a/src/interp/i-syscmd.boot b/src/interp/i-syscmd.boot
index 49e3aaae..ad5d19c8 100644
--- a/src/interp/i-syscmd.boot
+++ b/src/interp/i-syscmd.boot
@@ -1089,7 +1089,7 @@ addNewInterpreterFrame(name) ==
$interpreterFrameRing := [emptyInterpreterFrame(name),
:$interpreterFrameRing]
updateFromCurrentInterpreterFrame()
- _$ERASE histFileName()
+ removeFile makeFullFilePath histFileName()
emptyInterpreterFrame(name) ==
[name, -- frame name
@@ -1118,7 +1118,7 @@ closeInterpreterFrame(name) ==
found or (name ~= frameName(f)) => ifr := [f,:ifr]
found := true
not found => throwKeyedMsg("S2IZ0022",[name])
- _$ERASE makeHistFileName(name)
+ removeFile makeFullFilePath makeHistFileName(name)
$interpreterFrameRing := reverse! ifr
updateFromCurrentInterpreterFrame()
@@ -1563,7 +1563,7 @@ restoreHistory(fn) ==
curfile := histFileName()
histFileErase curfile
- _$FCOPY(restfile,curfile)
+ copyFile(makeFullFilePath restfile,makeFullFilePath curfile)
l:= # RKEYIDS curfile
$HiFiAccess:= true
@@ -2085,7 +2085,7 @@ reportOpsFromUnitDirectly0 D ==
reportOpsFromUnitDirectly1 D ==
showFile := pathname ['SHOW,'LISTING,$listingDirectory]
- _$ERASE showFile
+ removeFile makeFullFilePath showFile
$sayBrightlyStream: local :=
DEFIOSTREAM([['FILE,:showFile], '(MODE . OUTPUT)],255,0)
sayShowWarning()
@@ -2108,7 +2108,7 @@ reportOpsFromLisplib0(unitForm,u) ==
reportOpsFromLisplib1(unitForm,u) ==
showFile := pathname ['SHOW,'LISTING,$listingDirectory]
- _$ERASE showFile
+ removeFile makeFullFilePath showFile
$sayBrightlyStream: local :=
DEFIOSTREAM([['FILE,:showFile], '(MODE . OUTPUT)],255,0)
sayShowWarning()
diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
index feaa8cef..4212679b 100644
--- a/src/interp/lisplib.boot
+++ b/src/interp/lisplib.boot
@@ -409,7 +409,7 @@ compConLib1(fun,infileOrNil,outfileOrNil,auxOp,editFlag,traceFlag) ==
$editFile := infile
outfile := outfileOrNil or
[libName,'OUTPUT,$listingDirectory] --always QUIET
- _$ERASE(libName,'OUTPUT,$listingDirectory)
+ removeFile makeFullFilePath [libName,'OUTPUT,$listingDirectory]
outstream:= DEFSTREAM(outfile,'OUTPUT)
val:= _/D_,2_,LIB(fun,infile,outstream,auxOp,editFlag,traceFlag)
val
@@ -463,7 +463,7 @@ compileDocumentation(ctor,libName) ==
['dummy, $EmptyMode, $e]
initializeLisplib libName ==
- _$ERASE(libName,'ERRORLIB,$libraryDirectory)
+ removeFile makeFullFilePath [libName,'ERRORLIB,$libraryDirectory]
resetErrorCount()
$libFile := writeLib1(libName,'ERRORLIB,$libraryDirectory)
addCompilerOption('FILE,$libFile)
diff --git a/src/interp/nlib.lisp b/src/interp/nlib.lisp
index 243987a0..7fdc8a17 100644
--- a/src/interp/nlib.lisp
+++ b/src/interp/nlib.lisp
@@ -152,7 +152,8 @@
(push (setq entry (cons key (cons 0 value-or-pos)))
(|libIndexTable| rstream))
(progn
- (if (stringp (caddr entry)) ($erase (caddr entry)))
+ (if (stringp (caddr entry))
+ (|removeFile| (|makeFullFilePath| (caddr entry))))
(setf (cddr entry) value-or-pos)))
entry))
diff --git a/src/interp/sys-os.boot b/src/interp/sys-os.boot
index c8567d45..d6c5e8e0 100644
--- a/src/interp/sys-os.boot
+++ b/src/interp/sys-os.boot
@@ -57,6 +57,8 @@ getWorkingDirectory() ==
++ Copy a file.
import oa__copy__file: (string,string) -> int for doCopyFile
+ -- 0: success
+ -- otherwise: error.
copyFile(src,dst) ==
doCopyFile(src,dst) = 0 => nil
@@ -80,6 +82,9 @@ import oa__mkdir: string -> int for mkdir
++ Test whether a path names a directory.
import directoryp: string -> int for directoryp
+ -- -1: path does not exist or access denied
+ -- 0: path exists but is not directory
+ -- 1: path designates directory
++ Test whether a file exists and is accessible for read.
import readablep: string -> int for readablep
diff --git a/src/interp/sys-utility.boot b/src/interp/sys-utility.boot
index d30b73e3..a08d8715 100644
--- a/src/interp/sys-utility.boot
+++ b/src/interp/sys-utility.boot
@@ -200,14 +200,10 @@ probeReadableFile file ==
readablep file > 0 => file
nil
-++ original version returned 0 on success, and 1 on failure
-++ ??? fix that to return -1 on failure.
-$ERASE(:filearg) ==
- -removeFile makeFullFilePath filearg
-
++
$REPLACE(filespec1,filespec2) ==
- $ERASE(filespec1 := makeFullFilePath filespec1)
+ filespec1 := makeFullFilePath filespec1
+ removeFile filespec1
renameFile(makeFullFilePath filespec2, filespec1)
++
diff --git a/src/interp/word.boot b/src/interp/word.boot
index 3f3debd4..76b9ad16 100644
--- a/src/interp/word.boot
+++ b/src/interp/word.boot
@@ -63,7 +63,7 @@ writeFunctionTables(filemode) ==
'done
writeFunctionTable(filemode,name,dicts) ==
- _$ERASE makePathname(name,'DATABASE,filemode)
+ removeFile makeFullFilePath makePathname(name,'DATABASE,filemode)
stream:= writeLib1(name,'DATABASE,filemode)
if not $functionTable then
$functionTable:= buildFunctionTable dicts