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 #90233 is a reply to message #90232] Thu, 12 February 2015 13:17 Go to previous messageGo to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
> pro touch, path
> on_error, 2
>
> ;Directory -- Updates access, status change, and modified times.
> 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
>
> ;File -- updates access time
> endif else if file_test(path, /READ) then begin
> var = 0B
> openr, lun, path, /GET_LUN
> readu, lun, var
free_lun, lun
>
> ;Other
> endif else begin
> message, 'PATH must be a file with read privileges or a directory with write privileges.'
> endelse
> end

And, of course, I forget to close the file...
[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 13:40:39 PDT 2025

Total time taken to generate the page: 0.00410 seconds