Writing to specialFolderPath

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Writing to specialFolderPath

Post by Googie85 » Sun May 06, 2018 1:54 am

I am having trouble with the following code snippet...

Code: Select all

 put url ("file:" & specialFolderPath("engine") & slash & "FirstRun.txt" ) into blah
   answer blah
   
   put "2" into line 1 of url ("file:" & specialFolderPath("engine") & slash & "FirstRun.txt" )
   put url ("file:" & specialFolderPath("engine") & slash & "FirstRun.txt" ) into blah
   answer blah
It dose not write "2" to the file "FirstRun.txt". Any help would be greatly appreciated!!

Many Thanks,

Googie.

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Writing to specialFolderPath

Post by SparkOut » Sun May 06, 2018 7:53 am

The "engine" folder is not writeable on Android. Better get used to using the specialFolderPath ("resources") instead of "engine" - it is the same place but a more consistent reference created for this purpose of identifying the location of files and folders bundled under the copy tab of the standalone builder.
In order to make a save, you will need to write to the specialFolderPath ("documents") folder. It is case sensitive so use lower case d and it is privately writeable by your app, and will not generally be visible or browsable on an unrooted device.

Post Reply

Return to “Android Deployment”