Releases: nvzqz/FileKit
v6.1.0 fix warnings
v6.0.0 swift 5
Xcode project, SwiftPM, etc.. modified to swift 5 version. No code update.
v5.3.0 SwiftPM
SwiftPM compatibility
v5.2.0
Xcode 10, Swift 4.2 @IgorMuzyka
v5.1.0
v5.0.0
v4.0.1
v4.0.0
v3.0.0
Release Notes
This release is mainly to make all current features available.
New Features
- File system watching
- Added
workingDirectorytoProcess - Added
createFile(_:)create(_:)methods toPathandFile - Added reading and writing for
FilewithNSDatatype - Added grep operations for
TextFile - Added
init(groupIdentifier:)toPath - Added additional static paths
- Added
/operator for appending paths - Hard linking files
Changes
- Renamed
AllArrayandAllNamesinFileSystemEventFlagstoallFlagsandallFlagNames. - Changed returned description and debug description strings for
FileSystemEventFlags- Now contains the name of the type
FileSystemEventStreamis nowprivate- Removed global
NSFileManagerforPath- Each
Pathinstance now has afileManagerDelegate
- Each
- Expanded name abbreviations
- "CGD" -> "Dispatch"
Fixes
readFromPathforNSDatanow actually returns the contents- Fixed
commonAncestor(_:)method forPath
v2.0.0
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. 🔶
FileTypeis no longer a protocol for files. It is now an enumeration of types that a given file can be. TheFileclass is now the standard form of interacting with files.
New Features
-
FileKitenumeration to get info regarding the current version of FileKit -
tvOS support 📺
-
DirectoryEnumeratorstruct 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)
-
StringandPathconcatenation with the+operator -
A
changeDirectory(_:)toPaththat changes the process' current working
directory toselfPath.UserDesktop.changeDirectory { print(Path.Current) // "/Users/nvzqz/Desktop" }
-
Getting a common ancestor between two paths with the
<^>operator andcommonAncestor(_:)method -
Getting a resolved path with the
*postfix operator -
Getting an
NSFileHandlefor aFileorPath -
Pathnow conforms toSequenceType// Prints all of the paths in the user's home directory for path in Path.UserHome { print(path) }
-
Static
readFromPath(_:)method forReadabletypes that returnsSelf -
Pathnow conforms toStringInterpolationConvertible, which acts in the same way regularStringinterpolation works.let filePath: Path = "~/Desktop/File \(2)" print(filePath.rawValue) // "~/Desktop/File 2"
-
A
findmethod 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
NSStringandNSBundlethat take aPath -
Getting an
NSStreamfor aFileorPath -
Filenow conforms toComparableaccording to size -
FilePermissionsstruct 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
FileTypeas a protocol for filesFileTypeis now an enumeration of types that a file can be.Fileis now the standard way of interacting with files
- Renamed
FKErrortoFileKitError - Changed error parameters 'fromPath' and 'toPath' to 'from' and 'to' respectively
- Changed the
•postfix operator to%for standardizing path - Renamed
findPathsmethod tofindforPath - Changed path
urlproperty toURLand made it non-optional - The
findmethod now has-1as its defaultsearchDepth writableproperty forWritableConvertibleis now non-optional- Fix
+operator implementation