RBFilesystem Class Reference

Inherits from NSObject
Declared in RBFilesystem.h

Overview

Filesystem convenience methods.

+ pathTo:

Gets the local filesystem path to the given system directory.

+ (nullable NSString *)pathTo:(NSSearchPathDirectory)pathDirectory

Parameters

pathDirectory

The system directory.

Return Value

The retrieved path.

Declared In

RBFilesystem.h

+ pathToDocumentsDirectory

The path to the documents directory.

+ (nonnull NSString *)pathToDocumentsDirectory

Declared In

RBFilesystem.h

+ pathToTemporaryDirectory

The path to the temporary directory.

+ (nonnull NSString *)pathToTemporaryDirectory

Declared In

RBFilesystem.h

+ pathToBundleDirectory

The path to the bundle directory.

+ (nonnull NSString *)pathToBundleDirectory

Declared In

RBFilesystem.h

+ pathToCacheDirectory

The path to the cache directory.

+ (nonnull NSString *)pathToCacheDirectory

Declared In

RBFilesystem.h

+ filesAtPath:includeFullPaths:

Retrieves a list of the files at the path given.

+ (nullable NSArray<NSString*> *)filesAtPath:(nonnull NSString *)path includeFullPaths:(BOOL)includeFullPaths

Parameters

path

The path to retrieve the list of files from.

includeFullPaths

Whether each item should include the full path, or just the name.

Return Value

The NSArray file list.

Declared In

RBFilesystem.h

+ filesAtPath:withExtension:includeFullPaths:

Retrieves a list of the files at the path given that match the given extension.

+ (nullable NSArray<NSString*> *)filesAtPath:(nonnull NSString *)path withExtension:(nonnull NSString *)extension includeFullPaths:(BOOL)includeFullPaths

Parameters

path

The path to retrieve the list of files from.

extension

The extension to match.

includeFullPaths

Whether each item should include the full path, or just the name.

Return Value

The NSArray file list.

Declared In

RBFilesystem.h

+ directoriesAtPath:includeFullPaths:

Retrieves a list of the directories at the path given.

+ (nullable NSArray<NSString*> *)directoriesAtPath:(nonnull NSString *)path includeFullPaths:(BOOL)includeFullPaths

Parameters

path

The path to retrieve the list of directories from.

includeFullPaths

Whether each item should include the full path, or just the name.

Return Value

The NSArray directory list.

Declared In

RBFilesystem.h

+ fileExistsAtPath:

Determines whether or not a file exists at the given path.

+ (BOOL)fileExistsAtPath:(nonnull NSString *)path

Parameters

path

The path to the file.

Return Value

Whether or not the file exists.

Declared In

RBFilesystem.h

+ directoryExistsAtPath:

Determines whether or not a directory exists at the given path.

+ (BOOL)directoryExistsAtPath:(nonnull NSString *)path

Parameters

path

The path to the directory.

Return Value

Whether or not the directory exists.

Declared In

RBFilesystem.h

+ createDirectoryAtPath:

Creates a directory at the given path.

+ (BOOL)createDirectoryAtPath:(nonnull NSString *)path

Parameters

path

The path to create a directory at.

Return Value

Whether or not the operation was successful.

Declared In

RBFilesystem.h

+ modifiedDateWithPath:

Gets the modified date of the item at the given path.

+ (nullable NSDate *)modifiedDateWithPath:(nonnull NSString *)path

Parameters

path

The path to the item.

Return Value

The NSDate result.

Declared In

RBFilesystem.h

+ removeFileAtPath:

Removes the file at the given path.

+ (BOOL)removeFileAtPath:(nonnull NSString *)path

Parameters

path

The path to the file to remove.

Return Value

Whether or not the operation was successful.

Declared In

RBFilesystem.h

+ readDataOnceInBackground:filterBlock:completion:

Reads data from the disk asynchronously.

+ (nonnull id<RBCancellableTask>)readDataOnceInBackground:(nonnull NSString *)path filterBlock:(nullable NSData *__nonnull ( ^ ) ( NSData *__nonnull data ))filterBlock completion:(nullable void ( ^ ) ( NSData *__nullable data , NSError *__nullable error , BOOL wasCancelled ))completion

Parameters

path

The path to the item to read.

filterBlock

An optional block to filter the data.

completion

The completion block providing the result on completion.

Return Value

A task handle that can be used to cancel the operation.

Declared In

RBFilesystem.h