src/ios/CDVFile.m [376:449]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- (CDVFilesystemURL *)fileSystemURLforArg:(NSString *)urlArg
{
    CDVFilesystemURL* ret = nil;
    if ([urlArg hasPrefix:@"file://"]) {
        /* This looks like a file url. Get the path, and see if any handlers recognize it. */
        NSURL *fileURL = [NSURL URLWithString:urlArg];
        NSURL *resolvedFileURL = [fileURL URLByResolvingSymlinksInPath];
        NSString *path = [resolvedFileURL path];
        ret = [self fileSystemURLforLocalPath:path];
    } else {
        ret = [CDVFilesystemURL fileSystemURLWithString:urlArg];
    }
    return ret;
}

- (CDVFilesystemURL *)fileSystemURLforLocalPath:(NSString *)localPath
{
    CDVFilesystemURL *localURL = nil;
    NSUInteger shortestFullPath = 0;

    // Try all installed filesystems, in order. Return the most match url.
    for (id object in self.fileSystems) {
        if ([object respondsToSelector:@selector(URLforFilesystemPath:)]) {
            CDVFilesystemURL *url = [object URLforFilesystemPath:localPath];
            if (url){
                // A shorter fullPath would imply that the filesystem is a better match for the local path
                if (!localURL || ([[url fullPath] length] < shortestFullPath)) {
                    localURL = url;
                    shortestFullPath = [[url fullPath] length];
                }
            }
        }
    }
    return localURL;
}

- (NSNumber*)checkFreeDiskSpace:(NSString*)appPath
{
    NSFileManager* fMgr = [[NSFileManager alloc] init];

    NSError* __autoreleasing pError = nil;

    NSDictionary* pDict = [fMgr attributesOfFileSystemForPath:appPath error:&pError];
    NSNumber* pNumAvail = (NSNumber*)[pDict objectForKey:NSFileSystemFreeSize];

    return pNumAvail;
}

/* Request the File System info
 *
 * IN:
 * arguments[0] - type (number as string)
 *	TEMPORARY = 0, PERSISTENT = 1;
 * arguments[1] - size
 *
 * OUT:
 *	Dictionary representing FileSystem object
 *		name - the human readable directory name
 *		root = DirectoryEntry object
 *			bool isDirectory
 *			bool isFile
 *			string name
 *			string fullPath
 *			fileSystem = FileSystem object - !! ignored because creates circular reference !!
 */

- (void)requestFileSystem:(CDVInvokedUrlCommand*)command
{
    // arguments
    NSString* strType = [command argumentAtIndex:0];
    unsigned long long size = [[command argumentAtIndex:1] longLongValue];

    int type = [strType intValue];
    CDVPluginResult* result = nil;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/osx/CDVFile.m [339:412]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- (CDVFilesystemURL *)fileSystemURLforArg:(NSString *)urlArg
{
    CDVFilesystemURL* ret = nil;
    if ([urlArg hasPrefix:@"file://"]) {
        /* This looks like a file url. Get the path, and see if any handlers recognize it. */
        NSURL *fileURL = [NSURL URLWithString:urlArg];
        NSURL *resolvedFileURL = [fileURL URLByResolvingSymlinksInPath];
        NSString *path = [resolvedFileURL path];
        ret = [self fileSystemURLforLocalPath:path];
    } else {
        ret = [CDVFilesystemURL fileSystemURLWithString:urlArg];
    }
    return ret;
}

- (CDVFilesystemURL *)fileSystemURLforLocalPath:(NSString *)localPath
{
    CDVFilesystemURL *localURL = nil;
    NSUInteger shortestFullPath = 0;

    // Try all installed filesystems, in order. Return the most match url.
    for (id object in self.fileSystems) {
        if ([object respondsToSelector:@selector(URLforFilesystemPath:)]) {
            CDVFilesystemURL *url = [object URLforFilesystemPath:localPath];
            if (url){
                // A shorter fullPath would imply that the filesystem is a better match for the local path
                if (!localURL || ([[url fullPath] length] < shortestFullPath)) {
                    localURL = url;
                    shortestFullPath = [[url fullPath] length];
                }
            }
        }
    }
    return localURL;
}

- (NSNumber*)checkFreeDiskSpace:(NSString*)appPath
{
    NSFileManager* fMgr = [[NSFileManager alloc] init];

    NSError* __autoreleasing pError = nil;

    NSDictionary* pDict = [fMgr attributesOfFileSystemForPath:appPath error:&pError];
    NSNumber* pNumAvail = (NSNumber*)[pDict objectForKey:NSFileSystemFreeSize];

    return pNumAvail;
}

/* Request the File System info
 *
 * IN:
 * arguments[0] - type (number as string)
 *	TEMPORARY = 0, PERSISTENT = 1;
 * arguments[1] - size
 *
 * OUT:
 *	Dictionary representing FileSystem object
 *		name - the human readable directory name
 *		root = DirectoryEntry object
 *			bool isDirectory
 *			bool isFile
 *			string name
 *			string fullPath
 *			fileSystem = FileSystem object - !! ignored because creates circular reference !!
 */

- (void)requestFileSystem:(CDVInvokedUrlCommand*)command
{
    // arguments
    NSString* strType = [command argumentAtIndex:0];
    unsigned long long size = [[command argumentAtIndex:1] longLongValue];

    int type = [strType intValue];
    CDVPluginResult* result = nil;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



