New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Windows 10 - ctime is the same as the mtime #31022
Comments
@bicycle1885 I know the ctime means "change time". |
Isn't ctime on windows creation time and on Linux change time? |
@elextr no, on windows it's just the same as mtime |
@clouds56 what I meant was that it means different things on the underlying operating system and the Windows meaning seems to be the behaviour the OP is expecting. But libuv deliberately makes ctime always have the linux meaning change time on all platforms. So it likely changes when a file is edited and therefore equals mtime, so the case described by the OP is expected. But changing just the metadata (eg permissions/ACLs) should change only ctime not mtime so its not always the same. As noted in #39731 ctime description was wrong and has been fixed, and birth time is not available on all platforms. |
This probably should have been closed by #39731 |
the behaviour I was expecting was ctime was fixed at creation and mtime changed when modified I can't remember why now, but it was something like checking if mtime > ctime to do something |
stat.jl
mtime | Unix timestamp of when the file was last modified
ctime | Unix timestamp of when the file was created
c:\temp\test.txt
Properties tab
Created: 09 February 2019, 13:16:44
Modified: 09 February 2019, 13:16:55
Accessed: 09 February 2019, 13:16:44
julia> Dates.unix2datetime(ctime("c:\\temp\\test.txt"))
2019-02-09T13:16:55.233
julia> Dates.unix2datetime(mtime("c:\\temp\\test.txt"))
2019-02-09T13:16:55.233
wait a few minutes, edit the file
julia> Dates.unix2datetime(mtime("c:\\temp\\test.txt"))
2019-02-09T13:25:16.394
julia> Dates.unix2datetime(ctime("c:\\temp\\test.txt"))
2019-02-09T13:25:16.394
The text was updated successfully, but these errors were encountered: