All Projects â†’ fabiocaccamo â†’ Fcfilemanager

fabiocaccamo / Fcfilemanager

Licence: mit
iOS File Manager on top of NSFileManager for simplifying files management. 📂

Projects that are alternatives of or similar to Fcfilemanager

Voila
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.
Stars: ✭ 78 (-90.95%)
Mutual labels:  files, directory, file
files
Useful methods to manage files and directories
Stars: ✭ 27 (-96.87%)
Mutual labels:  files, directory, file
Copy
Go copy directory recursively
Stars: ✭ 264 (-69.37%)
Mutual labels:  directory, files, copy
Cpx
A cli tool to watch and copy file globs.
Stars: ✭ 394 (-54.29%)
Mutual labels:  directory, copy, file
Copy Webpack Plugin
Copy files and directories with webpack
Stars: ✭ 2,679 (+210.79%)
Mutual labels:  files, copy, file
FireFiles
Powerful Android File Manager for everything that runs on Android OS (Android TV, Android Watch, Mobile, etc)
Stars: ✭ 37 (-95.71%)
Mutual labels:  manager, file
replace-in-files
Replace text in one or more files or globs.
Stars: ✭ 21 (-97.56%)
Mutual labels:  files, file
Downgit
Create GitHub Resource Download Link
Stars: ✭ 936 (+8.58%)
Mutual labels:  directory, file
github-content
Easily download files from github raw user content.
Stars: ✭ 21 (-97.56%)
Mutual labels:  files, file
guess-filename.py
Derive a file name according to old file name cues and/or PDF file content
Stars: ✭ 27 (-96.87%)
Mutual labels:  files, file
Cryptolist
Curated collection of blockchain & cryptocurrency resources.
Stars: ✭ 3,501 (+306.15%)
Mutual labels:  directory, list
delete-empty
Recursively delete all empty folders in a directory and child directories.
Stars: ✭ 38 (-95.59%)
Mutual labels:  files, directory
directory-structure
📦 Print a directory tree structure in your Python code.
Stars: ✭ 40 (-95.36%)
Mutual labels:  directory, file
fs-utils
Generalized file and path utils for Node.js projects.
Stars: ✭ 33 (-96.17%)
Mutual labels:  copy, file
Pomf
Simple file uploading and sharing
Stars: ✭ 535 (-37.94%)
Mutual labels:  files, file
Filemasta
A search application to explore, discover and share online files
Stars: ✭ 571 (-33.76%)
Mutual labels:  files, file
Chibisafe
Blazing fast file uploader and awesome bunker written in node! 🚀
Stars: ✭ 657 (-23.78%)
Mutual labels:  files, file
speedcopy
Patched python shutil.copyfile to allow faster speeds on samba shares.
Stars: ✭ 13 (-98.49%)
Mutual labels:  files, copy
copy
Copy files using glob patterns. Sync, async, promise or streams. (node.js utility)
Stars: ✭ 84 (-90.26%)
Mutual labels:  files, copy
Chonky
😸 A File Browser component for React.
Stars: ✭ 313 (-63.69%)
Mutual labels:  files, file

FCFileManager Pod version Pod platforms Pod license

iOS File Manager on top of NSFileManager for simplifying files management. It provides many static methods for executing most common operations with few lines of code. It works by default in the Documents directory to allow use of relative paths, but it's possible to work easily on any other directory.

Requirements

  • iOS >= 5.0
  • ARC enabled

Installation

CocoaPods:

pod 'FCFileManager'

Manual install:

Copy FCFileManager.h and FCFileManager.m to your project.

Features

  • Build paths relative to absolute directories (FCFileManager works by default in the Documents directory, so you must build absolute paths only if you need to work outside of the Documents directory)
  • Copy files/directories
  • Create files/directories
  • Check if files/directory exists
  • Get files/directories attributes (creation date, size, ...)
  • List files/directories
  • Move files/directories
  • Read/Write files content in different formats (arrays, custom models, data, dictionaries, images, json, strings, ... )
  • Read/Write xattr (Extended File Attributes)
  • Read images metadata, EXIF data, TIFF data
  • Remove files/directories
  • Rename files/directories
  • Directories are created on the fly
  • Error handling as using NSFileManager

See FCFileManager.h for all of the methods.

Usage examples

Build path:

//my file path, this will be automatically used as it's relative to the Documents directory
NSString *testPath = @"test.txt";
//my file path relative to the temporary directory path
NSString *testPathTemp = [FCFileManager pathForTemporaryDirectoryWithPath:testPath];

/*
All shortcuts suppported:

pathForApplicationSupportDirectory;
pathForCachesDirectory;
pathForDocumentsDirectory;
pathForLibraryDirectory;
pathForMainBundleDirectory;
pathForPlistNamed:(NSString *)name; //look for {{ name }}.plist in the main bundle directory
pathForTemporaryDirectory;
*/

Copy file:

//copy file from Documents directory (public) to ApplicationSupport directory (private)
NSString *testPath = [FCFileManager pathForApplicationSupportDirectoryWithPath:@"test-copy.txt"];
[FCFileManager copyItemAtPath:@"test.txt" toPath:testPath];

Create file:

//create file and write content to it (if it doesn't exist)
[FCFileManager createFileAtPath:@"test.txt" withContent:@"File management has never been so easy!!!"];

Create directories:

//create directories tree for the given path (in this case in the Documents directory)
[FCFileManager createDirectoriesForPath:@"/a/b/c/d/"];

Check if file exists:

//check if file exist and returns YES or NO
BOOL testFileExists = [FCFileManager existsItemAtPath:@"test.txt"];

Move file:

//move file from a path to another and returns YES or NO
[FCFileManager moveItemAtPath:@"test.txt" toPath:@"tests/test.txt"];

Read file:

//read file from path and returns its content (NSString in this case)
NSString *test = [FCFileManager readFileAtPath:@"test.txt"];

Read/Write xattr (Extended File Attributes):

//returns the string-value stored for the specified key, if the key doesn't exist returns nil
NSString *value = [FCFileManager xattrOfItemAtPath:@"test.txt" getValueForKey:"uploaded"];

//set the specified string-value and returns a BOOL result of the operation
BOOL success = [FCFileManager xattrOfItemAtPath:@"test.txt" setValue:@"1" forKey:@"uploaded"];

Read image EXIF data:

//read image file from path and returns its EXIF data
NSDictionary *exifData = [FCFileManager exifDataOfImageAtPath:@"test.jpg"];

Remove file:

//remove file at the specified path
[FCFileManager removeItemAtPath:@"test.txt"];

Rename file:

//rename file at the specified path with the new name
[FCFileManager renameItemAtPath:@"test.txt" withName:@"test-renamed.txt"];

Write file:

NSArray *testContent = [NSArray arrayWithObjects:@"t", @"e", @"s", @"t", nil];

//write file at the specified path with content
[FCFileManager writeFileAtPath:@"test.txt" content:testContent];

Get file/directory size:

//get the file size in bytes
NSNumber *fileSize = [FCFileManager sizeOfFileAtPath:@"test.txt"];

//get the directory size in bytes (including all subdirectories and files inside it)
NSNumber *directorySize = [FCFileManager sizeOfDirectoryAtPath:@"/a/"];

Get file/directory size formatted:

//returns a human-readable file size formatted with the necessary suffix: bytes, KB, MB, GB, TB
NSString *fileSizeFormatted = [FCFileManager sizeFormattedOfFileAtPath:@"test.txt"];

Support development

Donate

License

Released under MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].