Reputation: 63359
I'd like to read file access times in a portable way. I found accessTime
in System.Posix.Files
, but it's POSIX only. Is there a portable, cross-platform way that would work both on Windows and POSIX systems?
Upvotes: 2
Views: 1236
Reputation: 191
As of directory-1.2.3 there is now System.Directory.getAccessTime.
Upvotes: 0
Reputation: 31305
You can use unix-compat to get both Windows and POSIX support for a lot of the functionality in the unix
package.
Upvotes: 2
Reputation: 23014
How about System.Directory.getModificationTime for modification time? For access time I'm not sure there is a portable way.
Upvotes: 6
Reputation: 944
On Windows you can use System.Win32.getFileTime function, second time - is last access time. How i know - no crossplatform way for this task.
Upvotes: 4