Use old approach for Mac OSX which, as of 2016, does not yet support POSIX
high-resolution file times.
This commit is contained in:
parent
53dfb21d6c
commit
3680cbaf25
1 changed files with 18 additions and 12 deletions
|
|
@ -275,6 +275,11 @@ type
|
||||||
## For a typed memory object, the length in bytes.
|
## For a typed memory object, the length in bytes.
|
||||||
## For other file types, the use of this field is
|
## For other file types, the use of this field is
|
||||||
## unspecified.
|
## unspecified.
|
||||||
|
when defined(macosx):
|
||||||
|
st_atime*: Time ## Time of last access.
|
||||||
|
st_mtime*: Time ## Time of last data modification.
|
||||||
|
st_ctime*: Time ## Time of last status change.
|
||||||
|
else:
|
||||||
st_atim*: Timespec ## Time of last access.
|
st_atim*: Timespec ## Time of last access.
|
||||||
st_mtim*: Timespec ## Time of last data modification.
|
st_mtim*: Timespec ## Time of last data modification.
|
||||||
st_ctim*: Timespec ## Time of last status change.
|
st_ctim*: Timespec ## Time of last status change.
|
||||||
|
|
@ -1610,13 +1615,14 @@ var
|
||||||
MSG_OOB* {.importc, header: "<sys/socket.h>".}: cint
|
MSG_OOB* {.importc, header: "<sys/socket.h>".}: cint
|
||||||
## Out-of-band data.
|
## Out-of-band data.
|
||||||
|
|
||||||
proc st_atime*(s: Stat): Time {.inline.} =
|
when not defined(macosx):
|
||||||
|
proc st_atime*(s: Stat): Time {.inline.} =
|
||||||
## Second-granularity time of last access
|
## Second-granularity time of last access
|
||||||
result = s.st_atim.tv_sec
|
result = s.st_atim.tv_sec
|
||||||
proc st_mtime*(s: Stat): Time {.inline.} =
|
proc st_mtime*(s: Stat): Time {.inline.} =
|
||||||
## Second-granularity time of last data modification.
|
## Second-granularity time of last data modification.
|
||||||
result = s.st_mtim.tv_sec
|
result = s.st_mtim.tv_sec
|
||||||
proc st_ctime*(s: Stat): Time {.inline.} =
|
proc st_ctime*(s: Stat): Time {.inline.} =
|
||||||
## Second-granularity time of last status change.
|
## Second-granularity time of last status change.
|
||||||
result = s.st_ctim.tv_sec
|
result = s.st_ctim.tv_sec
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue