how to read/write data on Android?

Ralph DiMola rdimola at evergreeninfo.net
Sun Mar 18 23:15:43 EDT 2012


I use this to copy a PDF and use it later. You can't write to the engine
folder.

      put specialFolderPath("engine") & slash into FileSrc
      put specialFolderPath("documents") & slash into FileDest
      if there is not a file (Filedest&"10Minutes on the CEO agenda.pdf")
then --only copy first time.
       put url ("binfile:"&FileSrc&"10Minutes on the CEO agenda.pdf") into
url ("binfile:"&FileDest&"10Minutes on the CEO agenda.pdf")
      end if

Later I do this 


put "10Minutes on the CEO agenda.pdf" into fName
   put specialFolderPath("documents") & slash into Fpath
   put Fpath & Fname into FullFileName

FullFileName now contains a fully qualified and read/writable file reference

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net

-----Original Message-----
From: use-livecode-bounces at lists.runrev.com
[mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of Mike Bonner
Sent: Sunday, March 18, 2012 11:04 PM
To: How to use LiveCode
Subject: Re: how to read/write data on Android?

I'm not sure but I don't think you have to set the default folder to
specialfolderpath("engine") pretty sure thats the default on start.

And since you area already pointing there you don't need a path to get to
the file, you might just try it as a relative file.

put URL ("binfile:" & "myfile.txt") into tData

Doing it the other way, I assume you've looked at the contents of tPath to
see if it makes sense?

after you set the defaultfolder to specialfolderpath("engine") you might
compare
the defaultfolder
to
specialfolderpath("engine") to see if something strange is going on there.

Either way, if you can set the defaultfolder first and then just do the
relative accessing at least you will hopefully be able to test other
functionality while you sort out all the pathing issues.
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list