Closed parkera closed 1 month ago
@swift-ci test
The linux test failure looks related:
Test Case 'DataIOTests.test_largeFile' started at 2024-05-20 18:29:52.910
/build/swift-foundation/Tests/FoundationEssentialsTests/DataIOTests.swift:215: error: DataIOTests.test_largeFile : XCTAssertEqual failed: ("2147549184") is not equal to ("2147479552") -
Test Case 'DataIOTests.test_largeFile' failed (17.749 seconds)
@swift-ci test
Updated to provide a "read until EOF" option, true by default. On Darwin we were always reading the requested 0x7ffffff
, but on Linux we were reading 0x7fff000
, then failing to loop again. This mirrors the implementation from swift-corelibs-foundation.
LGTM! Can we merge this?
Yah, I wanted @kperryua to take a second look if possible.
Yah, I wanted @kperryua to take a second look if possible.
Took me a bit to grok what the readUntilEOF change is about. I take a little issue with the name, since it presumes that the length
parameter is expected to be EOF of a regular file. That's only technically true in this particular case of Data reading, since we're first querying the length of the file on disk and then passing that parameter for length. In theory one could call this function with a length less than the full length of the file, if one has a limited buffer.
Yah, I wanted @kperryua to take a second look if possible.
Took me a bit to grok what the readUntilEOF change is about. I take a little issue with the name, since it presumes that the
length
parameter is expected to be EOF of a regular file. That's only technically true in this particular case of Data reading, since we're first querying the length of the file on disk and then passing that parameter for length. In theory one could call this function with a length less than the full length of the file, if one has a limited buffer.
Fair enough - it's more like readUntilLength
? I lifted the name from the equivalent function in swift-corelibs-foundation, where it is called with both Data
and FileHandle
reads.
it's more like
readUntilLength
I like that better.
Also, when asking for progress reporting, cap the number of updates at approximately 100 instead of fileSize/4k.