A small library to use for your file system.


Francium is part of the E-sites iOS Suite.

A small library to use for your file system.

forthebadge forthebadge

Platform CocoaPods Compatible Quality Travis-ci



pod 'Francium'

And then

pod install


Both File and Dir implement the following functions / properties:

 /// The absolute path:
/// `File("path: ./").absolutePath #=> /var/folders/6d/FranciumTests-61688042-63CA-4E70-A9A6-31BBBB12FD38/`
public var absolutePath: String 

/// Does the entry exist?
public var isExisting: Bool

/// The base name
/// `File("path: /usr/bin/testfile.swift") #=> testfile.swift`
public var basename: String 

/// The file (or directory) name without the final extension
/// `File("path: testfile.rb").name #=> testfile`
public var name: String

public var isDirectory: Bool 

/// The name of the directory
/// `File("path: testfile.rb").dirname #=> /var/folders/6d`
/// `Dir("path: ./").dirname #=> /var/folders/6d`
public var dirName: String

public var modificationDate: Date?
public var creationDate: Date?

// ---- Path

public func delete() throws
public func rename(to newName: String) throws
public func move(to dir: Dir, newName: String? = nil) throws 
public func copy(to dir: Dir, newName: String? = nil) throws

// ---- Permissions

public func chmod(_ value: Int)

public var permissions: Int?


/// The extension name
/// `File("path: testfile.rb").extensionName #=> rb`
public var extensionName: String

public static func create(path: String, permissions: Int = 0o0777) throws -> File
public func create() throws

public func write(data: Data) throws
public func write(string: String) throws
public func append(string: String) throws
public func append(data: Data) throws

public func read() throws -> Data
public var contents: String?


public static func create(path: String,
                          withIntermediateDirectories: Bool = true,
                          permissions: Int = 0o0777) throws -> Dir

public func make(withIntermediateDirectories: Bool = true) throws

public func glob(_ pattern: String) -> [File]
public func empty(recursively: Bool = true) throws


  • Swift Tools 5.0.0
View More Packages from this Author


  • None
Last updated: Tue Mar 19 2024 08:29:26 GMT-0900 (Hawaii-Aleutian Daylight Time)