specialFolderPaths

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

physicsclassroom
Posts: 50
Joined: Sun Jun 30, 2013 1:43 am
Location: Illinois
Contact:

Re: specialFolderPaths

Post by physicsclassroom » Fri Aug 17, 2018 6:52 pm

I have a theory: the dataStorage.livecode stack that I am trying to copy to the specialFolderPath("support") location is listed in my Standalone Applications Settings in the Copy Files pane. I do not list it in the Stacks pane. I noticed that a few of the stacks in my build (not all) that are listed in the Stacks pane are located outside of the "Resources" folder inside the application bundle. Perhaps when the engine uses revCopy to make a copy of a stack, it must first have a copy located in the directory with the executable (outside of the Resources folder)?

physicsclassroom
Posts: 50
Joined: Sun Jun 30, 2013 1:43 am
Location: Illinois
Contact:

Re: specialFolderPaths

Post by physicsclassroom » Fri Aug 17, 2018 6:55 pm

bwmilby wrote:
Fri Aug 17, 2018 6:36 pm
How does the main stack/app open the file that you copy? How does it save the data stack once it is updated?
You may want to consider changing the defaultfolder.
The script that contains the revCopy command to duplicate the stack into the "support" folder also creates three .txt files in the support folder. So I do set the defaultFolder to specialFolderPath("support").

bwmilby
Posts: 439
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: specialFolderPaths

Post by bwmilby » Fri Aug 17, 2018 7:03 pm

Interesting. Later this evening I should be able to build a test.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

physicsclassroom
Posts: 50
Joined: Sun Jun 30, 2013 1:43 am
Location: Illinois
Contact:

Re: specialFolderPaths

Post by physicsclassroom » Fri Aug 17, 2018 7:30 pm

bwmilby wrote:
Fri Aug 17, 2018 7:03 pm
Later this evening I should be able to build a test.
For what it is worth, I'm using LC9.0.0. I've used this same method (copying an app listed in the Stacks pane and storing data in them) in apps from a couple of years ago - except I copied to specialFolderPath("documents") and I created the apps in LC7. Otherwise my code is essentially the same.

bwmilby
Posts: 439
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: specialFolderPaths

Post by bwmilby » Sat Aug 18, 2018 3:19 am

I'm unable to reproduce the behavior that you are seeing. I created a test stack (parent) with a button and a couple of fields. The preOpenStack handler copies a stack from the resources special folder path to a fully qualified path. The second stack (empty) is included in the copy files section only - it only has a field where I can put some text to see if changes are saved.

Upon opening the stack, if the file does not exist in the destination folder, it is copied as expected. If it already exists, it is not updated using the revcopyfile handler.

If I get a list of the mainstacks, it is not listed. If I open the stack (empty), then it is listed. Regardless of which version I open (resources or the copied one), I am able to make a change and save it. At no point do I see a copy of the stack get placed in another location.

I did try the Application Support location as well.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

physicsclassroom
Posts: 50
Joined: Sun Jun 30, 2013 1:43 am
Location: Illinois
Contact:

Re: specialFolderPaths

Post by physicsclassroom » Sat Aug 18, 2018 4:08 am

Thanks for testing this Brian. I'm in the process or re-writting all storage/retrieval scripts to use text files instead of stacks. When done, I may turn back and look at this issue some more to see if I can find the problem. That would be two days from now.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”