-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fix for platform inconsistency in creation time #17272
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
Conversation
r? @alexcrichton how are we handling platform differences such as this? |
rtio::FileStat { | ||
size: stat.st_size as u64, | ||
kind: stat.st_mode as u64, | ||
perm: stat.st_mode as u64, | ||
created: mktime(stat.st_ctime as u64, stat.st_ctime_nsec as u64), | ||
created: created(stat), | ||
changed: changed(stat), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a "changed" field in the FileStat
structure, does this compile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wups, will fix.
just tested on my machine, build was successful. the errors in the travis build are not due to me i believe. care to give it another look @alexcrichton? |
There are Linux file systems with support for birth time, so it's not correct to stub it out like that. |
@thestinger can you point me to any? I've researched this fairly thorougly and it doesn't seem that there's a syscall that exposes birthtime as omasanori also pointed out here: I have, however, targetted bsd and mac os separately, as those do in fact support it. |
#[cfg(target_family = "unix")] | ||
fn changed(stat: &libc::stat) -> u64 { mktime(stat.st_ctime as u64, stat.st_ctime_nsec as u64) } | ||
#[cfg(target_os = "windows")] | ||
fn changed(_stat: &libc::stat) -> u64 { 0 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this field should be added just yet because windows doesn't support it and the structure of FileStat
is that the top levels are "officially supported"
If neither |
Closing due to inactivity, but feel free to reopen with my comments addressed! |
…r=Veykril Feat: hide double underscored symbols from symbol search Fixes rust-lang#17272 by changing the default behavior of query to skip results that start with `__` (two underscores). Not sure if this has any far reaching implications - a review would help to understand if this is the right place to do the filtering, and if it's fine to do it by default on the query. If you type `__` as your search, then we'll show the matching double unders, just in case you actually need the symbol.
this introduces a new field to the filestat struct which accounts for platform differences in time fields.