FileTime
These MEX-functions get and set the creation, access and write times of a file under Windows.
SetFileTime(FileName, Spec, DateVector, Type)
FileName: File or folder name, absolute or relative path.
Unicode names and UNC paths are accepted.
Spec: String, 'Creation', 'Access', 'Write'.
DateVector: [1 x 6] double vector (see DATEVEC) or UINT64.
Type: Optional, conversion method from local to UTC time.
Time = GetFileTime(FileName, Type, OutType)
FileName: File or folder name, absolute or relative path.
Type: Optional, conversion method from UTC to local time.
OutType: Optional, all three times as struct or a single time.
Time: Struct with fields 'Creation', 'Access', 'Write' or
one time, [1x6] DATEVEC or UINT64 format.
The Local<->UTC conversion needs Windows XP, Windows Server 2003 or higher. The LCC 2.4 compiler shipped with Matlab does not know the "new" time function.
Precompiled mex files can be downloaded at:
http://www.n-simon.de/mex
Tested: Matlab 6.5/2009a, WinXP, 32 bit, OWC1.8, BCC5.5, LCC 3.8, MSVC 2008
Compatibility to 64 bit Windows is assumed.
Cite As
Jan (2024). FileTime (https://www.mathworks.com/matlabcentral/fileexchange/24671-filetime), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.6.0.0 | Times can have native UINT64 format. GetFileTime can reply a single time, e.g. just 'Access' time. |
||
1.5.0.0 | Consider Unicode file names.
|
||
1.4.0.0 | Accept unicode names.
|
||
1.3.0.0 | Test function failed, if DIR replies localized names for dates as e.g. the German "24-Dez-2010". No problems for English OS versions and in the actual functions. |
||
1.2.0.0 | Access folders also |
||
1.1.0.0 | UTC<->local time conversion more consistent now and flexible. Thanks Bass for pointing to this problem! |
||
1.0.0.0 |