Saving To A Text File - Android
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Saving To A Text File - Android
I am having some issues with saving to a file on an Android device.
I have tried the following:
put "binfile:" & specialFolderPath("engine") & slash & "bell.txt" into textgoal
put "Testing 123" into URL textgoal
Also:
open file textgoal for text
write "Testing 123" to file textgoal
close file testgoal
If anyone could help with this I would be forever greatful...
Many Thanks,
Matthew.
I have tried the following:
put "binfile:" & specialFolderPath("engine") & slash & "bell.txt" into textgoal
put "Testing 123" into URL textgoal
Also:
open file textgoal for text
write "Testing 123" to file textgoal
close file testgoal
If anyone could help with this I would be forever greatful...
Many Thanks,
Matthew.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Saving To A Text File - Android
Hi Matthew,
Not sure if this will solve your problem but;
and you cannot write to specialFolderPath("engine") you should use specialFolderPath("documents") if you want to record a file.
Simon
Not sure if this will solve your problem but;
Code: Select all
put "binfile:" & specialFolderPath("engine") & slash & "bell.txt" into textgoal
--should be
put ("binfile:" & specialFolderPath("engine") & slash & "bell.txt") into textgoal
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Saving To A Text File - Android
I'm unsure how I would save a .txt file to the documents folder instead of engine...
Many Thanks,
Matthew.
Many Thanks,
Matthew.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Saving To A Text File - Android
oops made a little mistake above;
and to write
ooops ooops!
If bell.txt is really a text file then it's just URl("file:"... not URL("binfile:"...
Text is not a binary file.
Simon
Code: Select all
put URL("binfile:" & specialFolderPath("engine") & slash & "bell.txt") into textgoal
Code: Select all
put textgoal into URL("binfile:" & specialFolderPath("documents") & slash & "bell.txt")
If bell.txt is really a text file then it's just URl("file:"... not URL("binfile:"...
Text is not a binary file.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Saving To A Text File - Android
Just for clarity:
specialFolderPath("documents") is a writable location, sandboxed to be accessible only to the app. Other apps will have their own sandboxed documents folder. It is not a generally accessible folder for any and all user documents. The specialFolderPath folders are automatically accessible to you app, but the names are case sensitive (ie lower case only) on mobile (mixed case is OK on desktop, and the paths have different destinations - on desktop "documents" really does mean the user documents folder).
specialFolderPath("documents") is a writable location, sandboxed to be accessible only to the app. Other apps will have their own sandboxed documents folder. It is not a generally accessible folder for any and all user documents. The specialFolderPath folders are automatically accessible to you app, but the names are case sensitive (ie lower case only) on mobile (mixed case is OK on desktop, and the paths have different destinations - on desktop "documents" really does mean the user documents folder).
Re: Saving To A Text File - Android
Hi Matt,
please spread the word: the ENGINE folder is TABOO for writing!
Best
Klaus
please spread the word: the ENGINE folder is TABOO for writing!
We have a specialfolderpath() for both of these, please take a look in the dictionary!I'm unsure how I would save a .txt file to the documents folder instead of engine...
Best
Klaus