Skip to content

Releases: nvzqz/FileKit

v6.1.0 fix warnings

20 Feb 08:54
Compare
Choose a tag to compare

Minor update to fix SwiftLint and Xcode warnings

Xcode 14.2 used, minimum OS version updated (ex iOS: 12.0)

v6.0.0 swift 5

01 Sep 19:38
Compare
Choose a tag to compare

Xcode project, SwiftPM, etc.. modified to swift 5 version. No code update.

v5.3.0 SwiftPM

01 Sep 19:40
Compare
Choose a tag to compare

SwiftPM compatibility

v5.2.0

18 Sep 07:17
Compare
Choose a tag to compare

Xcode 10, Swift 4.2 @IgorMuzyka

v5.1.0

17 Sep 20:47
Compare
Choose a tag to compare

Xcode 9.3, Swift 4.1

v5.0.0

17 Sep 20:46
v5.0.0
Compare
Choose a tag to compare

Xcode 9, Swift 4.0

v4.0.1

05 Apr 04:39
v4.0.1
Compare
Choose a tag to compare
Twelfth release

v4.0.0

05 Oct 18:21
v4.0.0
Compare
Choose a tag to compare
  • swift 3

v3.0.0

20 Jul 23:15
Compare
Choose a tag to compare

Release Notes

This release is mainly to make all current features available.

New Features

  • File system watching
  • Added workingDirectory to Process
  • Added createFile(_:) create(_:) methods to Path and File
  • Added reading and writing for File with NSData type
  • Added grep operations for TextFile
  • Added init(groupIdentifier:) to Path
  • Added additional static paths
  • Added / operator for appending paths
  • Hard linking files

Changes

  • Renamed AllArray and AllNames in FileSystemEventFlags to allFlags and allFlagNames.
  • Changed returned description and debug description strings for FileSystemEventFlags
    • Now contains the name of the type
  • FileSystemEventStream is now private
  • Removed global NSFileManager for Path
    • Each Path instance now has a fileManagerDelegate
  • Expanded name abbreviations
    • "CGD" -> "Dispatch"

Fixes

  • readFromPath for NSData now actually returns the contents
  • Fixed commonAncestor(_:) method for Path

v2.0.0

25 Nov 00:17
Compare
Choose a tag to compare

Release Notes

Important:

  • The 'FK' prefix for FileKit types has been removed in an effort to make the library less cumbersome and more "Swifty" to use. 🔶
  • FileType is no longer a protocol for files. It is now an enumeration of types that a given file can be. The File class is now the standard form of interacting with files.

New Features

  • FileKit enumeration to get info regarding the current version of FileKit

  • tvOS support 📺

  • DirectoryEnumerator struct to enumerate through the files in a directory.

  • Settable path extension

  • A path's children can now be obtained recursively

    let allFilesInHome = Path.UserHome.children(recursive: true)
  • String and Path concatenation with the + operator

  • A changeDirectory(_:) to Path that changes the process' current working
    directory to self

    Path.UserDesktop.changeDirectory {
        print(Path.Current)  // "/Users/nvzqz/Desktop"
    }
  • Getting a common ancestor between two paths with the <^> operator and commonAncestor(_:) method

  • Getting a resolved path with the * postfix operator

  • Getting an NSFileHandle for a File or Path

  • Path now conforms to SequenceType

    // Prints all of the paths in the user's home directory
    for path in Path.UserHome {
        print(path)
    }
  • Static readFromPath(_:) method for Readable types that returns Self

  • Path now conforms to StringInterpolationConvertible, which acts in the same way regular String interpolation works.

    let filePath: Path = "~/Desktop/File \(2)"
    print(filePath.rawValue)  // "~/Desktop/File 2"
  • A find method with a search depth that maps a function on each path found and returns the non-nil results.

    let documents = Path.UserDocuments.find(searchDepth: 1) { String($0) }
  • Initializers for NSString and NSBundle that take a Path

  • Getting an NSStream for a File or Path

  • File now conforms to Comparable according to size

  • FilePermissions struct for seeing the permissions of the current process for a given file.

    let swift: Path = "/usr/bin/swift"
    print(swift.filePermissions)  // FilePermissions[Read, Execute]

Changes

  • Removed 'FK' prefix from FileKit types in an effort to make the library more Swifty
  • Removed FileType as a protocol for files
    • FileType is now an enumeration of types that a file can be.
    • File is now the standard way of interacting with files
  • Renamed FKError to FileKitError
  • Changed error parameters 'fromPath' and 'toPath' to 'from' and 'to' respectively
  • Changed the postfix operator to % for standardizing path
  • Renamed findPaths method to find for Path
  • Changed path url property to URL and made it non-optional
  • The find method now has -1 as its default searchDepth
  • writable property for WritableConvertible is now non-optional
  • Fix + operator implementation