Handbook
Glossary
touch-file ( path -- )
Vocabulary
io
.
directories
Inputs
path
a pathname string
Outputs
None
Word description
Updates the modification time of a file or directory. If the file does not exist, creates a new, empty file.
Errors
Throws an error if the file could not be touched.
Definition
USING:
io.backend
;
IN:
io.directories
HOOK:
touch-file
io-backend
( path -- )
Methods
USING:
io.backend
io.backend.unix
io.directories
io.directories.unix
io.files
kernel
system
unix
;
M:
unix
touch-file
normalize-path
dup
file-exists?
[
touch
]
[
touch-mode
file-mode
open-file
close-file
]
if
;