-
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
Proposal: Add Temporary and Sparse and to FileOptions #65155
Comments
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsDiscussed in #65067Originally posted by msedi February 9, 2022 The question in general is, does Another solution might be try
{
File.SetAttributes(fileName, File.GetAttributes(fileName) | FileAttributes.Temporary);
}
catch
{
} but this looks a bit clumsy.
|
@msedi we have a particular format for API proposals like this one. Could you please update your top post to match the API proposal format, per this template Or simply close this and use that template to open a new one. |
@msedi it would be great if you could also provide some more information about why you need these features: example scenario that is impossible to implement as of today and some benchmark numbers for spare files |
This issue has been marked |
FWIW I did a quick check and Linux defines macOS does not: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/open.2.html |
This issue has been automatically marked |
This issue will now be closed since it had been marked |
Discussed in #65067
Originally posted by msedi February 9, 2022
From the WinAPI (https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea) I can see that there is a
FILE_ATTRIBUTE_TEMPORARY
flag when creating a file which seems to be very useful in my case.The question in general is, does
FILE_ATTRIBUTE_TEMPORARY
have an effect? I assume some other flags its only a hint to the file manager. I can also understand that this is not available on other platforms, but if it can be seen as a hint only (windows), it could also be seen as such in other platforms.Additionally the sparsity of a file could tremendously help to improve performance for large files. Currently there are two possibilities
SetFileValidData
orDeviceIoControl
that allow to create sparse files.Another solution might be
but this looks a bit clumsy.
The text was updated successfully, but these errors were encountered: