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.

Discussion

Gets the local filesystem path to the given system directory.

Declared In

RBFilesystem.h

+ pathToDocumentsDirectory

The path to the documents directory.

+ (nonnull NSString *)pathToDocumentsDirectory

Discussion

The path to the documents directory.

Declared In

RBFilesystem.h

+ pathToTemporaryDirectory

The path to the temporary directory.

+ (nonnull NSString *)pathToTemporaryDirectory

Discussion

The path to the temporary directory.

Declared In

RBFilesystem.h

+ pathToBundleDirectory

The path to the bundle directory.

+ (nonnull NSString *)pathToBundleDirectory

Discussion

The path to the bundle directory.

Declared In

RBFilesystem.h

+ pathToCacheDirectory

The path to the cache directory.

+ (nonnull NSString *)pathToCacheDirectory

Discussion

The path to the cache directory.

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.

Discussion

Retrieves a list of the files at the path given.

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.

Discussion

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

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.

Discussion

Retrieves a list of the directories at the path given.

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.

Discussion

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

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.

Discussion

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

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.

Discussion

Creates a directory at the given path.

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.

Discussion

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

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.

Discussion

Removes the file at the given path.

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.

Discussion

Reads data from the disk asynchronously.

Declared In

RBFilesystem.h