Skip to content

A simple node-like file operation library with swift.

License

Notifications You must be signed in to change notification settings

teabyii/Sample.swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample.swift

Build status Coverage Carthage compatible

A simple node-like file operation library with swift.

Requirements

  • iOS 8.4
  • Xcode 7.3 (Swift 2.2)

Installation

Using Carthage

Add github "jsenjoy/Sample.swift" to Cartfile in your project and run carthage update --platform iOS.

If unfamiliar with Carthage then checkout their Getting Started section or this sample app

Then add import Sample to the top of the files using Sample.swift.

Manually

Download the file Sample.swift and then add to your project.

Usage

do {
  let content = try Sample.readFile(path)
  print(content)
} catch {}

APIs

  • access(path: String, mode: Int)
  • appendFile(filename: String, data: String)
  • chmod(path: String, mode: Int)
  • chmod(path: String, mode: String)
  • chown(path: String, uid: Int, gid: Int)
  • mkdir(path: String)
  • stat(path: String) -> [String: AnyObject]
  • exists(path: String) -> Bool
  • readdir(path: String) -> [String]
  • readFile(file: String) -> String
  • writeFile(file: String, data: String)
  • rename(path: String, another: String)
  • rmdir(path: String)
  • unlink(path: String)

License

Sample.swift is released under an MIT license. See the LICENSE file for more information.

About

A simple node-like file operation library with swift.

Resources

License

Stars

Watchers

Forks

Packages

No packages published