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
sys::Path enhancements #1161
Comments
Oh yeah, one trivial improvement to MappedFile would remove a syscall: void MappedFile::initialize() {
There is no reason to call Path::exists (a syscall). Instead, just call open, and if it fails, you know the file -Chris |
The FileStauts info will be cached in my next commit. |
With these patches: all requested functionality for this PR has been implemented. |
Thanks Reid!! Question, isn't \network\device\blah absolute on win32? -Chris |
Yes, it is. And, Jeff C already fixed it :) Since I can't (easily) compile for win32, I just write place holders and Jeff There's one remaining issue for this: uniqueness of Paths via the UniqueID field So, this is currently an unresolved issue on win32 port. Perhaps I should open |
Ah, woot!
Okay, either way. Since we don't have a client for this yet, it isn't a big deal.
This needs to be an inode/volume number pair, -Chris |
Extended Description
I have been working on some code that will hopefully land in LLVM at some point, and it needs to
efficiently grovel through the file system. Here are a few things that libsystem should do that it doesn't
currently:
starts with /, on win32, starts with c:\ or \network\device).
Right now I'm using (dir + "/" + file), which works fine on unix, but sucks on win32. :)
files, even those that are symlinked together. If the st_dev/st_ino fields of two files match, they are the
same, but Path::getStatus doesn't expose these.
return "/foo" for "bar" it should return "." on unix.
In terms of efficiency enhancements, it would be nice if sys::Path cached the status returned by stat, so
that calls to things like getSize etc, didn't restat for every call. It would also be nice if MappedFile took
in a file size argument so that you could map a file (which was previously stat'ed) without having
MappedFile restat it. If sys::Path cached the Status info, it would be natural to pass a path to
MappedFile to make this all transparent.
-Chris
The text was updated successfully, but these errors were encountered: