Skip to content

Commit

Permalink
Codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
weichsel committed Jun 10, 2024
1 parent f0015e2 commit 1dc5722
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/ZIPFoundation/FileManager+ZIP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,14 @@ extension FileManager {
guard fileManager.itemExists(at: url) else {
throw CocoaError(.fileReadNoSuchFile, userInfo: [NSFilePathErrorKey: url.path])
}

let entryFileSystemRepresentation = fileManager.fileSystemRepresentation(withPath: url.path)
var fileStat = stat()
lstat(entryFileSystemRepresentation, &fileStat)
guard fileStat.st_size >= 0 else {
throw CocoaError(.fileReadTooLarge, userInfo: [NSFilePathErrorKey: url.path])
}
var stat = stat()
lstat(entryFileSystemRepresentation, &stat)
guard stat.st_size >= 0 else { throw CocoaError(.fileReadTooLarge, userInfo: [NSFilePathErrorKey: url.path]) }

// `st_size` is a signed int value
return Int64(fileStat.st_size)
return Int64(stat.st_size)
}

class func typeForItem(at url: URL) throws -> Entry.EntryType {
Expand Down
1 change: 1 addition & 0 deletions Tests/ZIPFoundationTests/ZIPFoundationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ extension Data {

#if os(macOS)
extension NSUserScriptTask {

static func makeVolumeCreationTask(at tempDir: URL, volumeName: String) throws -> NSUserScriptTask {
let scriptURL = tempDir.appendingPathComponent("createVol.sh", isDirectory: false)
let dmgURL = tempDir.appendingPathComponent(volumeName).appendingPathExtension("dmg")
Expand Down

0 comments on commit 1dc5722

Please sign in to comment.