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 enhancement: add PathWithStatus #1663
Comments
This isn't quite trivial. A lot of regular "Path" methods depend on the ability There are several other examples of these that I'm not quite sure how to I'll work on this and come up with a solution. |
The solution is to just use stat(2) directly. In all of these cases it would be |
Implemented with these patches: Jeff: |
Question: why not move isExecutable etc to PathWithStatus? -Chris |
Because isReadable and isWritable need to be on Path and it didn't seem like a Its also less impact to LLVM to leave it in Path class. |
Extended Description
Getting the status of a sys::path curently requires new'ing the status object. It would be nice if we
could make a subclass PathWithStatus, and move the 'status' related stuff there. This would give us
something like this:
class PathWithStatus : public Path {
Status S;
bool IsStatusValid;
}
If you sink the 'status gathering' methods out of Path into
PathWithStatus, then you let the client decide whether they want to
store a status or not, and if they want it, they don't have to pay for a separate malloc.
-Chris
The text was updated successfully, but these errors were encountered: