Saving to /mnt/ directory

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bqsbarbqGAnC5Z
Posts: 77
Joined: Thu Dec 08, 2011 12:19 pm

Saving to /mnt/ directory

Post by bqsbarbqGAnC5Z »

Hi Everyone,

I've been reading a lot of stuff about saving a txt file to the SD card and whatnot, but I'm not quite sure how to save to my phone memory since I don't have an SD card in my phone.

Ive been using

Code: Select all

put the cVariable of this stack into url("file:" & specialFolderPath("mnt/sdcard") & "/filename.txt")
but I whenever I run this, a file is never created in this directory, or any other directory I try. I chose mnt/sdcard because it seemed to be the default folder in my phone. Anyone have any suggestions that I can try?

Thanks for reading!
Cool Dave
Posts: 35
Joined: Mon Jun 25, 2012 8:44 pm

Re: Saving to /mnt/ directory

Post by Cool Dave »

Hi,

Have you tried specialfolderpath("documents") ? According to my research, that should be the folder for application data.

If that doesn't work, look up specialfolderpath in the dictionary, if you haven't already. I'd like to know if "documents" doesn't do it.

All the best,
Dave
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Saving to /mnt/ directory

Post by jacque »

SpecialFolderPath gives access to certain specific system folders as listed in the dictionary. The location you want to write to isn't in that list, so you can't use specialFolderPath. Just use the file path by itself:

put the cVariable of this stack into url ("file:/mnt/sdcard/filename.txt")

I'm not positive that's the right path exactly but it's the right idea.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
bqsbarbqGAnC5Z
Posts: 77
Joined: Thu Dec 08, 2011 12:19 pm

Re: Saving to /mnt/ directory

Post by bqsbarbqGAnC5Z »

Hm, thanks for the posts guys but neither of these seemed to have solved my problem. Still can't get any txt files to write to my memory. I'm going to keep playing with it and report back if I make any progress.
BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Saving to /mnt/ directory

Post by BvG »

Most likely your path to the folder on your drive is wrong. To find the correct path, try this:

Code: Select all

on mouseUp
  answer folder ""
  put it
end mouseUp
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Saving to /mnt/ directory

Post by Mark »

Hi,

Are you sure that answer folder works on mobile devices?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Saving to /mnt/ directory

Post by BvG »

oh... no idea, i always forget to check which forum a topic is in :)
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Saving to /mnt/ directory

Post by Klaus »

No, this does NOT work on mobile devices.
Post Reply