Renaming files without preserving their date and creation time
3 ビュー (過去 30 日間)
古いコメントを表示
I want to rename files but without preserving their original date and creation times.So far, Ive tried two options:
OPTION 1:
dos(['copy "' old_name'" "' new_name'"']); dos(['del "' old_name]);
OPTION 2: dos(['ren "' old_name'" "' new_name'"']);
... but both of them create the new files, yet preserving the original creation date/time. Can anyone help me?
thanks!
0 件のコメント
採用された回答
Walter Roberson
2013 年 5 月 26 日
See the "copy" command of the second Answer in http://stackoverflow.com/questions/51435/windows-version-of-the-unix-touch-command
It is a hack, but an amusing one. It works by saying to copy the file with something appended to it, but leaving what is to be appended empty. The file gets copied and because of the marker to append, the time gets updated.
Or see the last answer in the above link, that points to http://www.funduc.com/fstouch.htm -- note that can be run from the command line as well. It would probably be much faster than the "copy" version.
3 件のコメント
Walter Roberson
2013 年 5 月 26 日
It appears to me that that fstouch program might be able to do that.
その他の回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!