Creating A Directory - Android

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Creating A Directory - Android

Post by Googie85 » Tue Dec 22, 2015 10:03 am

Hey Guys!

I am having trouble with creating a directory on my Android tablet. I am using the following;

create directory "/mnt/sdcard/MyApp/Test"

I have also tried create folder but to no avail...

Any help is appreciated,

Many Thanks,

Matthew.

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

Re: Creating A Directory - Android

Post by Dixie » Tue Dec 22, 2015 11:28 am

Hi...

To create a folder on your tablet and at the same time, say an empty text file... try this

Code: Select all

on openStack
   set the defaultFolder to specialFolderPath("documents")
   if there is not a folder "myfolder" then
      create folder "myfolder"
      set the defaultFolder to specialFolderPath("documents") & "/myfolder
      put empty into URL("file:" & "mytextstuff")
   end if
end openStack
Other standard file locations can be queried using the specialFolderPath() function. The following paths are supported on Android:

engine – the (virtual) path to the engine and its assets
documents – the path to a folder to use for per-application data files
cache – the path to a folder to use for transient per-application data files

The Android filesystem is case-sensitive – this is different from (most) Mac installs and Windows so take care to ensure that you consistently use the same casing of filenames when constructing them.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Creating A Directory - Android

Post by jacque » Tue Dec 22, 2015 7:50 pm

Be sure that you have selected "Write external storage" in the Android standalone settings. Also, be aware that devices may see external storage differently so the path may not be the same on all devices. On my Samsung S5 the path to external storage is "/sdcard/". On other devices it may be in "/mnt/" as you have it (I think it was that way on my S4 but I don't have a card in that one any more so I can't check.)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply