Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: %Touch.r and Touch Dialect

From: greggirwin::mindspring::com at: 10-Jun-2003 11:15

Hi Andrew, Neat idea! Here's a litle TOUCH function I wrote some time ago that could be used in conjunction with your dialect. 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 rd-only ][ if not with [time: now] ; We have to turn off the read-only attribute if it's on. foreach item compose [(files)] [ rd-only: not get-modes item 'owner-write set-modes to-file item [owner-write: true modification-date: time] if rd-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 ] -- Gregg