io.unix.files: New version of touch-file
parent
2b7bd1a8e1
commit
e0ddb3d0eb
|
@ -45,9 +45,10 @@ M: unix (file-appender) ( path -- stream )
|
||||||
|
|
||||||
M: unix touch-file ( path -- )
|
M: unix touch-file ( path -- )
|
||||||
normalize-path
|
normalize-path
|
||||||
touch-mode file-mode open
|
dup exists?
|
||||||
dup 0 < [ err_no EEXIST = [ err_no io-error ] unless ] when
|
[ f utime ]
|
||||||
close ;
|
[ touch-mode file-mode open close ]
|
||||||
|
if ;
|
||||||
|
|
||||||
M: unix move-file ( from to -- )
|
M: unix move-file ( from to -- )
|
||||||
[ normalize-path ] bi@ rename io-error ;
|
[ normalize-path ] bi@ rename io-error ;
|
||||||
|
|
Loading…
Reference in New Issue