Page 1 of 1

save file data writes to bundle.

Posted: Fri Jun 20, 2008 1:45 pm
by reelstuff
I have a script, that is intended to create a folder and write a file to that
folder to be used later to verify a license file.

Currently the folder is being created in the bundle directory, which I expect the script is doing what it is told, however,

the file is blank when written to the folder.

Which baffles me, so I thought that perhaps it would be better to create the folder
in the directory where the application is installed instead of the bundle file.

This is MAC, windows I dont think has this issue.

As it just creates the folder along side the exe file.

So this script works with windows but not MAC due to some write issue in the bundle or at least that is my guess.

So how would I create a folder along side the application instead of inside the bundle?

Code: Select all

on saveRegFileGen
  put the effective filename of this stack into tPath
set the itemDelimiter to "/"
put "regFileGen/" into last item of tPath
if there is not a folder tPath then create folder tPath
set the filetype to ""
put fld Field_regData1 into URL ("file:" & tPath & "RegData")
wait 5 ticks
end saveRegFileGen
Thanks in advance for any suggestions

Tim

Posted: Fri Jun 20, 2008 1:52 pm
by Klaus
Hi reelstuff,

check "the result" immediately after creating the folder and after writing the file!

It should be empty on success and contain a description of the error, which is mostly "can't create directory", which probably means the current user does not have write permission here.

HINT:
Use
specialfolderpath("preferences")
or the users home directory to store any data outside the app!
There you definitively have write permission!


Best

Klaus

Thank you

Posted: Fri Jun 20, 2008 2:13 pm
by reelstuff
HI, thank you That explains what I was missing, I will have a go at that approach.

Tim