Location of copied file?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 332
Joined: Sun Apr 15, 2012 1:17 am
Contact:

Location of copied file?

Post by Newbie4 » Wed Jul 11, 2012 3:49 am

In the Standalone Application Settings, under CopyFiles, I copy a data file to load on start-up. In the code I set the default folder to specialFolderPath of 'home' and it works for Mac builds okay

When I build a standalone for IOS (iPad), it does not. I tried 'home', 'engine', documents' and nothing seemed to make a difference.

For IOS, where is the file copied to?

Thank you
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Location of copied file?

Post by Jellicle » Wed Jul 11, 2012 4:47 am

If the file can be found when LC builds the app it should be in the engine. Show us the code you are using?

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 332
Joined: Sun Apr 15, 2012 1:17 am
Contact:

Re: Location of copied file?

Post by Newbie4 » Wed Jul 11, 2012 11:47 am

Code: Select all

set the defaultFolder to specialFolderPath("engine")
put URL ("file:" &  "testClassData.CSV") into fn
put fn into field "instudents" 

I tried other combinations (putting the path into the URL, etc,) This is the last iteration. I also tried 'home' and other variations.
It works under Mac but not IOS
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/

Klaus
Posts: 14183
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Location of copied file?

Post by Klaus » Wed Jul 11, 2012 12:01 pm

Hi Newbie4,

hmm, some ideas:

1. the iOS filesystem is CASE sensitive, so please doublecheck the spelling of the filename

2. check for existence of that file:

Code: Select all

...
put specialfolderpath("engine") & "/testClassData.CSV" into tFile
answer (there is a file tFile)
## should give TRUE or FALSE
...
3. I read about some problems with setting the defaultfolder on iOS,
so use absolute pathnames whenever possible:

Code: Select all

...
put specialfolderpath("engine") & "/testClassData.CSV" into tFile
put url("file:" & tFile) into fld "instudents"

## check for errors reading the file. "the result" = EMPTY on success!
if the result <> empty then
  answer "Error reading file:" && the result
end if
...
Best

Klaus

Post Reply