필터 지우기
필터 지우기

Renaming files without preserving their date and creation time

조회 수: 1 (최근 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!

채택된 답변

Walter Roberson
Walter Roberson 2013년 5월 26일
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
Walter Roberson 2013년 5월 26일
It appears to me that that fstouch program might be able to do that.
Mario Trevino
Mario Trevino 2013년 5월 26일
yes it seems so. thanks Walter! mario

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by