reading & writing files

when using application.readTXTFile() & application.writeTXTFile()
to work with files on the user’s machine, it seems that both
functions are creating and expecting to find files related
to the servoy folder.

i need to read (& write) files in the user’s home directory
(mac os 10.3).

i’ve tried using plugins.file.getHomeDirectory() to get a
path to the user’s home directory (“/users/robertmeyer”),
then specifing that value to writeTXTFile(), but it returns
‘false’, and the file is not created.

how can i read & write files in places other than the servoy
directory?

rc9-b268

thanks.
rm.

Robert,

plugins.file.getHomeDirectory() gives you a JSFile. That means you first have to convert that to an absolutepath with:

plugins.file.getHomeDirectory().getAbsolutePath()…

That way you have a string you can use for reading and writing that file into the home directory…

perfect!

you have saved the day once again Marcel.
thank you.

are you affiliated with the servoy group?

nope, I just like to work with the 8) Servoy environment…

Wow, I just noticed that your comment triggered me to do my 1.000th posting on this forum…

IT2BE:
Wow, I just noticed that your comment triggered me to do my 1.000th posting on this forum…

wow!

probably about half of those were you helping me…