Giter VIP home page Giter VIP logo

Comments (2)

haniewais avatar haniewais commented on June 11, 2024 4

It seems that there are some system API calls in this codebase
In Zip.swift, the creationDate and modificationDate API's are called.

#if os(Linux)
    // On Linux, setting attributes is not yet really implemented.
    // In Swift 4.2, the only settable attribute is `.posixPermissions`.
    // See https://github.com/apple/swift-corelibs-foundation/blob/swift-4.2-branch/Foundation/FileManager.swift#L182-L196
    directoryAttributes = nil
#else
    directoryAttributes = [.creationDate : creationDate, // ⬅️ ⭐️ System API call 
                           .modificationDate : creationDate] // ⬅️ ⭐️ System API call 
#endif

https://github.com/marmelroy/Zip/blob/bca30f6d6c7d37cbc4aa8f6b0002e281dcc36195/Zip/Zip.swift#L188C1-L197C19


Also here:

do {
    let fileAttributes = try fileManager.attributesOfItem(atPath: filePath)
    if let fileDate = fileAttributes[FileAttributeKey.modificationDate] as? Date {  // ⬅️ ⭐️ System API call 
        let components = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: fileDate)
        zipInfo.tmz_date.tm_sec = UInt32(components.second!)
        zipInfo.tmz_date.tm_min = UInt32(components.minute!)
        zipInfo.tmz_date.tm_hour = UInt32(components.hour!)
        zipInfo.tmz_date.tm_mday = UInt32(components.day!)
        zipInfo.tmz_date.tm_mon = UInt32(components.month!) - 1
        zipInfo.tmz_date.tm_year = UInt32(components.year!)
    }
    if let fileSize = fileAttributes[FileAttributeKey.size] as? Double {
        currentPosition += fileSize
    }
}

https://github.com/marmelroy/Zip/blob/bca30f6d6c7d37cbc4aa8f6b0002e281dcc36195/Zip/Zip.swift#L342C1-L356C18

from zip.

linhaosunny avatar linhaosunny commented on June 11, 2024

@marmelroy Any Plan for support Apple Privacy Manifest for cocoapods?

from zip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.