Page 1 of 1

iphoneSetDoNotBackupFile

Posted: Sat Mar 09, 2013 7:17 pm
by FireWorx
Hi,
I can set the do not back up attribute for a folder within the IOS documents folder to true with the following script but when I check the status of a file within that folder it returns false.

SO does that mean the folder and files are protected from backups? Or do I need to set a repeat loop and set the do not back up for each file within the folder? It seems like if the folder itself is protected all the files within it would also be protected. There is no iphoneSetDoNotBackupFolder function just a iphoneSetDoNotBackupFile .

What do you think?
Dave

on mouseUp
put specialfolderpath ("documents") & "/MyFolder" into tMyFile
iphoneSetDoNotBackupFile tMyFile, true
get iphoneDoNotBackupFile(tMyFile)
answer it ## Returns TRUE
------
put specialfolderpath ("documents") & "/MyFolder/MyFile.pdf" into tMyFile
if there is a file tMyFile then
get iphoneDoNotBackupFile(tMyFile)
answer it ## Returns FALSE
end if
end mouseup

Re: iphoneSetDoNotBackupFile

Posted: Sat Mar 09, 2013 7:57 pm
by Dixie
fireworx...

You have to protect individual files... not try and protect a folder hoping that will set the 'doNotBackUp' flag for all the files contained within it...

To see what protection a file has then use the iphoneFileDataProtection function.

be well

Dixie

Re: iphoneSetDoNotBackupFile

Posted: Sat Mar 09, 2013 9:11 pm
by FireWorx
Thanks Dixie,
I will set a repeat loop and set the do not back up for each file in each of the 7 folders then.

I built the stack before all this iCloud back up stuff became an issue and my stack is scattered with code with paths to documents/myfolder. I am afraid of the debugging associated with a massive find and replace operation in order to change the path to the library/support items folder.

I am hoping apple will be ok with the do not back up attribute applied to my folders and files as is in the documents folder.
Dave

Re: iphoneSetDoNotBackupFile

Posted: Sun Mar 10, 2013 6:44 pm
by FireWorx
Hi,
I just heard back from Monte who built the external to accomplish this task before the iphoneSetDoNotBackupFile functionality was built into LiveCode. The external is now depreciated based on the LC upgrade.

It is his opinion that you can use the iphoneSetDoNotBackupFile on a folder of files rather than individual files and the property is recursive. in other words the files within the protected folder will also be protected from being backed up. He commented that his answer is backed up in objective-c. This is how his external used to work.

I just wanted to clarify for anyone else that was wondering about this.

Thanks,
Dave

Re: iphoneSetDoNotBackupFile

Posted: Sun Mar 10, 2013 7:29 pm
by Dixie
fireworx...

If it backs up all the files in a folder, then that is good as it will save you some lines of script. However, a folder of files is not mentioned in the release notes... I guess the only way to know is to test it..:-)

Dixie

Re: iphoneSetDoNotBackupFile

Posted: Sun Mar 10, 2013 9:33 pm
by FireWorx
Yea kind of hard to test it though.

iphoneDoNotBackupFile(filename) returns FALSE even if the folder containing it is TRUE

Setting that feature prevents the specific folder from being backed up to the iCloud. How would you go about testing to see if the iCloud backed it up or not? My iCloud is not backing up regardless due to a password username fiasco.

I think Ill just trust in Monte roll the dice and submit the app.

Dave