Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Quickest way to change the last modified date on a textfile.

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
mdhutchinson
668 Views, 4 Replies

Quickest way to change the last modified date on a textfile.

I know I can re-write the file... but is there a more elegent way to change the file date?

4 REPLIES 4
Message 2 of 5
owenwengerd
in reply to: mdhutchinson

I don't think you have to write anything. Just open it for append, then immediately close it again.

--
Owen Wengerd
ManuSoft
Message 3 of 5
mdhutchinson
in reply to: owenwengerd

(close (open MyFile "a"))... then shouldn't this do it?  For some reason it does not.

Message 4 of 5
owenwengerd
in reply to: mdhutchinson

In that case I would simply append something that can be easily filtered out when reading, such as a line feed.

--
Owen Wengerd
ManuSoft
Message 5 of 5
Gary_J_Orr
in reply to: mdhutchinson

Try this:

copy the file to a new file (on my system doing so puts the current date-time to the property on the new file)

Delete the original

rename the new file to the original

 

(setq Filename "E:\\RandD\\filesystem.txt")
(setq tempFileName (strcat Filename "2"))
(vl-file-copy Filename tempFileName)
(vl-file-delete Filename)
(vl-file-rename tempFileName Filename)

 

-Gary

Gary J. Orr
(Your Friendly Neighborhood) CADD/BIM/VDC Applications Manager
http://www.linkedin.com/in/garyorr

aka (current and past user names):
Gary_J_Orr (GOMO Stuff 2008-Present); OrrG (Forum Studio 2005-2008); Gary J. Orr (LHB Inc 2002-2005); Orr, Gary J. (Gossen Livingston 1997-2002)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost