src/ios/CDVFile.m [1001:1020]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    [self.commandDelegate runInBackground:^ {
        NSString* callbackId = command.callbackId;

        // arguments
        CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
        id argData = [command argumentAtIndex:1];
        unsigned long long pos = (unsigned long long)[[command argumentAtIndex:2] longLongValue];

        NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];


        [fs truncateFileAtURL:localURI atPosition:pos];
        CDVPluginResult *result;
        if ([argData isKindOfClass:[NSString class]]) {
            NSData *encData = [argData dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
            result = [fs writeToFileAtURL:localURI withData:encData append:YES];
        } else if ([argData isKindOfClass:[NSData class]]) {
            result = [fs writeToFileAtURL:localURI withData:argData append:YES];
        } else {
            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Invalid parameter type"];
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/osx/CDVFile.m [938:957]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    [self.commandDelegate runInBackground:^ {
        NSString* callbackId = command.callbackId;

        // arguments
        CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
        id argData = [command argumentAtIndex:1];
        unsigned long long pos = (unsigned long long)[[command argumentAtIndex:2] longLongValue];

        NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];


        [fs truncateFileAtURL:localURI atPosition:pos];
        CDVPluginResult *result;
        if ([argData isKindOfClass:[NSString class]]) {
            NSData *encData = [argData dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
            result = [fs writeToFileAtURL:localURI withData:encData append:YES];
        } else if ([argData isKindOfClass:[NSData class]]) {
            result = [fs writeToFileAtURL:localURI withData:argData append:YES];
        } else {
            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Invalid parameter type"];
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



