Skip to content
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

[release/6.0-rc2] File preallocationSize: align Windows and Unix behavior. #59532

Merged
merged 5 commits into from
Sep 24, 2021

Commits on Sep 24, 2021

  1. Align preallocationSize behavior (dotnet#58726)

    Co-authored-by: Stephen Toub <stoub@microsoft.com>
    2 people authored and jozkee committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    ee72add View commit details
    Browse the repository at this point in the history
  2. File preallocationSize: align Windows and Unix behavior. (dotnet#59338)

    * File preallocationSize: align Windows and Unix behavior.
    
    This aligns Windows and Unix behavior of preallocationSize for the
    intended use-case of specifing the size of a file that will be written.
    
    For this use-case, the expected FileAccess is Write, and the file should be
    a new one (FileMode.Create*) or a truncated file (FileMode.Truncate).
    Specifing a preallocationSize for other modes, or non-writable files throws ArgumentException.
    
    The opened file will have a length of zero, and is ready to be written to by the user.
    
    If the requested size cannot be allocated, an IOException is thrown.
    
    When the OS/filesystem does not support pre-allocating, preallocationSize is ignored.
    
    * fix pal_io preprocessor checks
    
    * pal_io more fixes
    
    * ctor_options_as.Windows.cs: fix compilation
    
    * Update tests
    
    * tests: use preallocationSize from all public APIs
    
    * pal_io: add back FreeBSD, fix OSX
    
    * tests: check allocated is zero when preallocation is not supported.
    
    * Only throw for not enough space errors
    
    * Fix compilation
    
    * Add some more tests
    
    * Fix ExtendedPathsAreSupported test
    
    * Apply suggestions from code review
    
    Co-authored-by: David Cantú <dacantu@microsoft.com>
    
    * Update System.Private.CoreLib Strings.resx
    
    * PR feedback
    
    * Remove GetPathToNonExistingFile
    
    * Fix compilation
    
    * Skip checking allocated size on mobile platforms.
    
    Co-authored-by: David Cantú <dacantu@microsoft.com>
    tmds and jozkee committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    bf02a2d View commit details
    Browse the repository at this point in the history
  3. Fix unused fileDescriptor

    jozkee committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    8adba3a View commit details
    Browse the repository at this point in the history
  4. void fd when unused

    jozkee committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    f85919f View commit details
    Browse the repository at this point in the history
  5. Address feedback

    jozkee committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    861959e View commit details
    Browse the repository at this point in the history