-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Support FAT file attributes on non-Windows platforms #30178
Comments
I have no problems with this conceptually if someone wants to try to prototype an implementation. |
This is my first time looking at the CoreFX codebase or doing Linux interop, but I tried creating a basic implementation. Thoughts: |
We check for API availability in configure.cmake. And use the defines created there in the code.
My gut feel is that we should report hidden on Unix whenever there is a leading period, even if the file system has a hidden attribute as well. We did the same thing for Mac I believe.
It would, and we'd have to measure it. And we'd want to look at the impact of checking the filesystem before making these calls. If it's super costly we can consider making it an opt-in feature.
That's fine, but we need to be super careful that we're always null terminated. |
Did some performance testing and the results aren't great. Iterating through filesystem entries takes about 2us each on my machine. Simply doing an open/close on an entry takes a little over 4us. Enumerating entries and reading FAT attributes on every one takes 3x as long as not reading FAT attributes. |
Since the performance impact is nowhere near negligible, what would making the feature opt-in look like? |
Probably adding another flag to EnumerationOptions. At least that is what I would propose as a starting point. |
That would still leave APIs like Aside from having it opt-in at some higher level, which seems like a poor option, the obvious options I see would be adding new overloads to the methods and constructors. |
Triage: |
I'd be interested, @carlossanlop. The issue is how to do it without a performance regression on Linux. A new flag for EnumerationOptions could work for the file enumeration APIs, leaving at least the |
New functionality in Core that doesn't exist in Framework is normal and expected. We absolutely don't want to regress performance in the existing APIs. There are tricky aspects to making an API for this that will impact getting it approved, notably what do we do about other file systems? NTFS on Unix? etc...
I think this will be a good exercise to go through. Investigating what it would take to add a second file system would be important I think. One important caveat: I am not familiar with the APIs around this space so there may be other major considerations I'm not aware of yet. :) |
I was thinking more of functionality differences between Windows and non-Windows platforms. Like where the standard As for what a set of extensible file system APIs might look like, here's what first comes to mind.
Possible pros:
Possible cons:
|
I think with this one we'd need to do some prototyping to look at how we might design API around the functionality we're looking for. Without concrete code it would be difficult to rationalize a generic API shape. The downside, of course, is that prototyping effort takes time and may not result in shipping code. :) |
I went ahead and added that to see how it could work, @JeremyKuhne. Thealexbarney@1d090e3 It seems like there would be 2 levels of options here. One would be to add FAT attribute etc. functionality to the Unix build so it matches Windows functionality. I feel like supporting at least FAT features across platforms in the base libraries would be useful because FAT has kind of become the common file system readable by almost everything. The other would be to have a more generic API shape as discussed above for filesystem-specific operations or maybe platform-specific file operations. This may or may not include things like extended file attributes, info like Unix's |
This is still something that would be useful to me |
.NET Core currently does not support getting or setting many file attributes in FAT filesystems on non-Windows platforms..
There is a syscall in Linux that allow reading and writing FAT attributes. As these attributes are filesystem-specific, they could be ignored for filesystems that don't support them.
Having this feature would be useful for ensuring consistent behavior between platforms.
The text was updated successfully, but these errors were encountered: