incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shazron <shaz...@gmail.com>
Subject Re: iOS : setMetadata on backup file/directory does not work
Date Tue, 09 Oct 2012 21:37:47 GMT
File a new bug just in case so this can be tracked.

On Mon, Oct 1, 2012 at 11:28 PM, Clemens Wyss DEV <clemensdev@mysign.ch> wrote:
> Environment: Cordova 2.0 on iOS
>
> Trying to set "do-not-copy-toiCloud"-metadata on the backuped WebSQL files/directories
fails.
> Here my code (mostly copied from http://docs.phonegap.com/en/2.1.0/cordova_file_file.md.html#FileEntry
):
>
> function setMetadata( filePath, metadataKey, metadataValue, isFile )
> {
> var onSetMetadataWin = function() {
>   alert( "success setting metadata " + filePath )
> }
> var onSetMetadataFail = function( error ) {
>   alert( "error setting metadata " + filePath + "(" + error + ")" )
> }
>
> var onGetFileWin = function(parent) {
>   parent.setMetadata(onSetMetadataWin, onSetMetadataFail, { metadataKey: metadataValue});
> }
> var onGetFileFail = function() {
>   alert( "error getting file " + filePath )
> }
>
> var onFSWin = function(fileSystem) {
>         if ( isFile )
>                 fileSystem.root.getFile( filePath, { create: false, exclusive: false
}, onGetFileWin, onGetFileFail );
>         else
>                 fileSystem.root.getDirectory( filePath, { create: false, exclusive: false
}, onGetFileWin, onGetFileFail );
> }
>
> var onFSFail = function(evt) {
>   alert(evt.target.error.code);
> }
>
> window.requestFileSystem( LocalFileSystem.PERSISTENT, 0, onFSWin, onFSFail );
> }...
> setMetadata( "Backups/websqldbs.appdata.db", "com.apple.MobileBackup", 1, false );
> setMetadata( "Backups/websqlmain.appdata.db", "com.apple.MobileBackup", 1, true );
>
> I end up in onSetMetadataFail, hence the file/directory-entry is found.
> Unfortunately I don't know the structure oft he error object, so I have no details about
the exact error ...
>
> Could this be related to https://issues.apache.org/jira/browse/CB-1566 ?
>

Mime
View raw message