Advice and opinion on saving txt journal files

Hi everybody
I want to create a simple journal app
To manually enter some info about how the project evolve
The app will be on Mac server and gone be move frequently
And gone be for osx client only

I thought to save the db txt file in the package of the app itself
(to be sure of the location) and cant be modify easily

Question:
Which format will be appropriate to save different info to parse in each relative text box
How can i save a db txt file inside the package (Is it a good idea)
Any advice appreciate

Can be done on Xojo
But prefer RS 2012 2.1
Thanks

Do not save your DB to the app package.

  1. you cannot write to the app package
  2. if user needs to upgrade, or reinstall your app, they lose all of their data.

Save the DB to SpecialFolder.ApplicationData.child(“myFolder”)
This is the preferred location.

The app will be move frequently
If the “my folder” is forgot behind only once
the db will be re-create then merging with the old will be a mess

Move to where? Neverthe less, you cannot write to the app package.

Further thought, if you mean the same user will be using the app on different computers, then the problem is how to sync the data between locations. Saving to a web location is often the solution

The app will move from folder to folder on the same drive (server)
But different user will access on different mac
reflexion continue
thanks

Then the SpecialFolder.ApplicationData is the location where you should safe your data making it accessible from anywhere on that Mac.

ok i understand
A place outside of these project folder (like on the first level of the server)

Second question: The format
raw text
xml
json
sqllite
Which is best (easiest for that task)
To separate data for parsing in different text box (read & write)
Thanks

Depends on the nature of your data. I would probably lean toward a SQLite DB

For a few textbox
i just found that use all sql protocol login etc…
is it not too much ?
i dont have problem with that… just want to use the right way for my needs

It all depends on your strengths as a programmer. If you are good with databases that is a good option. If you have never used a database but are fine with another system then that is probably better so you don’t have to learn to interact with the database, especially if you have a limited timeframe.

You can write to the app package, I do it all the time. It’s just not valid for Apple Store or signed apps or apps on non-writable media.

To upgrade such apps I add ‘Export data to desktop’ and ‘Import data from desktop’ menu items.

Using SpecialFolder.ApplicationData.Child("My Application").Child("theappjournal.log") really is what you want to use. That location is the same for every user on your system and the data you create is not mangled by Apple’s OS X update process. You do need to create the “My Application” folder.

Of course, those names should be changed to match your app’s requirement.

Finally, this is good for OS X and Windows.

Tim,

slight hijack…
would something like

SpecialFolder.ApplicationData.Child( App.ExecutableFile.Name ).Child(App.ExecutableFile.Name + “.log”) work ?

just thought it would be an excellent way to create a log file for any program.

[quote=154083:@Russ Lunn]Tim,

slight hijack…
would something like

SpecialFolder.ApplicationData.Child( App.ExecutableFile.Name ).Child(App.ExecutableFile.Name + “.log”) work ?

just thought it would be an excellent way to create a log file for any program.[/quote]
I’ve created a module that already handles your own app folder, and allows you to access a bunch of other useful locations as natively and future resistant as possible. It’s free and easy to use, instructions are in the notes: http://timi.me/xojo.html

Certainly, and that would make it generic enough to create a shared module. The naming convention is totally up to you, but most apps have settled on the standards of

ApplicationData/App Name/Filename

or

ApplicationData/Company Name/App Name/Filename

I tend to use the second version as we have a number of apps that would be installed on one computer, so having their data in a shared “TOLIS Group” folder keeps things neat.

Thanks for the reply
A little late but i’v test some code before come back
I want to put the database not localy in the computer but in a ressource folder on the server
How can i reach the root of the server (from the app position)
the i enter in the ressource folder X
thanks