https://github.com/eonist/filestreamer
Continuous data to disk
https://github.com/eonist/filestreamer
file-streaming file-sync file-system ios macos nsfilemanager swift
Last synced: about 1 year ago
JSON representation
Continuous data to disk
- Host: GitHub
- URL: https://github.com/eonist/filestreamer
- Owner: eonist
- Created: 2019-12-20T12:12:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-21T11:28:11.000Z (almost 2 years ago)
- Last Synced: 2025-03-27T23:24:36.397Z (about 1 year ago)
- Topics: file-streaming, file-sync, file-system, ios, macos, nsfilemanager, swift
- Language: Swift
- Homepage:
- Size: 125 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README



# FileStreamer
> Continuous data to disk
### Installation:
- SPM `"https://github.com/light-stream/FileStreamer.git"` branch: `"master"`
### Writer example:
```swift
let filePath: String = NSString(string: "~/Desktop/del.txt").expandingTildeInPath
guard let data: Data = ("black dog" as NSString).data(using: String.Encoding.utf8.rawValue) else {Swift.print("unable to create data");return}
FSWriter.write(url: URL(filePath), data: data, index: 0)
```
### Reader example:
```swift
let filePath: String = NSString(string: "~/Desktop/del.txt").expandingTildeInPath
let data: Data = FSReader.read(filePath: filePath, startIndex: 50, endIndex: 100)
Swift.print("\(String(data: data, encoding: .utf8))") // blalbslalballabalbla...
```
### Size example:
```swift
let fileSize = FSReader.fileSize(filePath: filePath)
```