Hello,
How can I rename a file without changing its timestamp(s)? You know all files have the last access on and so on and I would like to rename file without touching it.
Printable View
Hello,
How can I rename a file without changing its timestamp(s)? You know all files have the last access on and so on and I would like to rename file without touching it.
I don't think you can.
There must be an option since I can manually rename files in Windows without changing any timestamps.
Are you sure on this?... Whenever you access a file, the Date Accessed attribute is updated.... And to rename a file, you must access it... You can see this by select a folder in Windows Explorer, change the view to details and customize your detail view to include the Date Accessed field. Now just pick any file and note the date accessed on it... Wait a few minutes and rename that file... Refresh the screen (by go to another folder then back) and bang... the date accessed field now is updated with the new value.Quote:
Originally Posted by kaisellgren
Yes. Date created, accessed and modified remained the same after renaming files manually.
Did you refresh the screen after renaming a file?Quote:
Originally Posted by kaisellgren
I just tried it out and the Date Accessed field changed after a rename, even if I didn't refresh the screen.Quote:
Originally Posted by kaisellgren
<double post>
When you System.IO.File.Move() (to rename), you should still have the same create and modified date on it. If you don't, and it shouldn't come to this, you can still use the System.Io.File.SetCreationTime()/SetLastAccessTime()/etc() methods. Incidentally, a lot of the major world religions wouldn't be so disparate if the .NET framework had existed back then, as we'd all have one SetCreationTime() and no arguments.
:rolleyes: I just reported this post and they think they will impose a 10 day ban. ;)Quote:
Originally Posted by mendhak