11.6.2.2130
RENAME-FILE
FILE EXT
(
c-addr
1
u
1
c-addr
2
u
2
--
ior
)
Rename the file named by the character string
c-addr
1
u
1
to the name in the character string
c-addr
2
u
2
.
ior
is the implementation-defined I/O result code.
Testing:
:
fn3
S"
fatest3.txt"
;
:
>end fid1
@
FILE-SIZE
DROP
fid1
@
REPOSITION-FILE
;
T{ fn3
DELETE-FILE
DROP
-> }T
T{ fn1 fn3
RENAME-FILE
-> 0 }T
\
Return value is undefined
T{ fn1
FILE-STATUS
SWAP
DROP
0=
-> <FALSE> }T
T{ fn3
FILE-STATUS
SWAP
DROP
0=
-> <TRUE> }T
T{ fn3
R/W
OPEN-FILE
SWAP
fid1
!
-> 0 }T
T{ >end -> 0 }T
T{
S"
Final line" fid1
@
WRITE-LINE
-> 0 }T
T{ fid1
@
FLUSH-FILE
-> 0 }T
\
Can only test
FLUSH-FILE
doesn't fail
T{ fid1
@
CLOSE-FILE
-> 0 }T
\
Tidy the test folder
T{ fn3
DELETE-FILE
DROP
-> }T
Forth 2012
Forth 2012
File-Access word set
Foreword
Proposals Process
200
x
Membership
Introduction
Terms, notation, and references
Usage requirements
Documentation requirements
Compliance and labeling
Glossary
Block word set
Double-Number word set
Exception word set
Facility word set
File-Access word set
Floating-Point word set
Locals word set
Memory-Allocation word set
Programming-Tools word set
Search-Order word set
String word set
Extended-Character word set
Rationale
Bibliography
Compatibility analysis
Portability guide
Reference Implementations
Test Suite
Alphabetic list of words
Glossary
Introduction
Additional terms
Additional usage requirements
Additional documentation requirements
Compliance and labeling
Glossary
RENAME-FILE
(
BIN
CLOSE-FILE
CREATE-FILE
DELETE-FILE
FILE-POSITION
FILE-SIZE
INCLUDE-FILE
INCLUDED
OPEN-FILE
R/O
R/W
READ-FILE
READ-LINE
REPOSITION-FILE
RESIZE-FILE
S"
SOURCE-ID
W/O
WRITE-FILE
WRITE-LINE
FILE-STATUS
FLUSH-FILE
INCLUDE
REFILL
RENAME-FILE
REQUIRE
REQUIRED
S\"