iphoneSetDoNotBackupFile

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

iphoneSetDoNotBackupFile

Post by FireWorx » Sat Mar 09, 2013 7:17 pm

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

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: iphoneSetDoNotBackupFile

Post by Dixie » Sat Mar 09, 2013 7:57 pm

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

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: iphoneSetDoNotBackupFile

Post by FireWorx » Sat Mar 09, 2013 9:11 pm

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

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: iphoneSetDoNotBackupFile

Post by FireWorx » Sun Mar 10, 2013 6:44 pm

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

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: iphoneSetDoNotBackupFile

Post by Dixie » Sun Mar 10, 2013 7:29 pm

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

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: iphoneSetDoNotBackupFile

Post by FireWorx » Sun Mar 10, 2013 9:33 pm

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

Post Reply