[Mono-list] Getting the milliseconds of a file's stat information

Robert Jordan robertj at gmx.net
Thu Dec 1 10:06:04 EST 2011


Hi Matthias,

On 01.12.2011 15:01, Mathias Tausig wrote:
> I want to read the creation/modify date information of a file and want
> to use the Mono.Unix.Native.Stat structure for it.
> I create the Stat variable either via UnixFileSystemInfo.ToStat or
> directly with Mono.Unix.Native.Syscall.stat, both methods have the same
> issue.
> My problem is, that the information I get from that, is only precice up
> to the second, but the 'stat' command issued on the linux command line
> shows me a more precise information, for instance:
> Modify: 2011-12-01 14:37:18.586409216 +0100
>
> Is there any way to acces this infomation from within mono (apart from
> parsing the command line output of stat)?

The nanosecond resolution fields are not exposed by Mono.Posix's
stat (). Maybe because they are non-standard and a PITA to map...

Robert



More information about the Mono-list mailing list