touch: func [
{Set the modification timestamp of the file.}
files [file! block!] "The file, or files, you want to stamp"
/with "Use a specified time rather than the current time."
time [date!] "The date and time to stamp them with"
/local read-only?
][
if not with [time: now]
; We have to turn off the read-only attribute if it's on.
foreach item compose [(files)] [
read-only?: not get-modes item 'owner-write
set-modes to-file item [owner-write: true modification-date: time]
if read-only? [set-modes item [owner-write: false]]
]
; Should we return the time, even though it may not match the actual
; stamp on the files due to OS differences?
;time
]
You need to create an account or log in to post comments to this site.