Page 1 of 1

Location of copied file?

Posted: Wed Jul 11, 2012 3:49 am
by Newbie4
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

Re: Location of copied file?

Posted: Wed Jul 11, 2012 4:47 am
by Jellicle
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

Re: Location of copied file?

Posted: Wed Jul 11, 2012 11:47 am
by Newbie4

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

Re: Location of copied file?

Posted: Wed Jul 11, 2012 12:01 pm
by Klaus
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