comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Linux-like touch command in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Linux-like touch command in IDL [message #90221 is a reply to message #90220] Thu, 12 February 2015 07:09 Go to previous messageGo to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
> pro touch, path
> if file_test(path, /DIRECTORY, /WRITE) then begin
> temp_file = filepath('touch_temp_file.txt', ROOT_DIR=path)
> openw, lun, temp_file, /GET_LUN
> free_lun, lun
> file_delete, temp_file
> endif else if file_test(path, /WRITE) then begin
> openw, lun, path, /GET_LUN
> free_lun, lun
> endif else begin
> message, 'PATH must be a file or directory with write privileges.'
> endelse
> end

Fixed a few typos.

This will update time time stamps of a file (and create it, if need be), or a directory (so long as the directory already exists). Write privileges are required.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: EDG: Using IDL_MakeTempStruct() vs. IDL_ImportArray()
Next Topic: Variable attributes and undef vars

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:34:28 PDT 2025

Total time taken to generate the page: 0.00437 seconds