Stezzyg
Stezzyg

Reputation: 39

Where should my .txt file location be?

I'm designing a simple program for a server to keep track of a number. Several people will be accessing this server and pressing a button to increase the number by 1. Where should my saveFile.txt used to keep track of the number be located? Within the project resources? As a separate file on the server?

Upvotes: 0

Views: 42

Answers (2)

Serge Ballesta
Serge Ballesta

Reputation: 149175

It really depends on your server organization and on the OS. But anyway the project resources is definitely a bad choice, because the resources can end into a war or jar file and be non modifiable at run time.

A common way would be to store the path of the file in a project resource. That way it will be easy to change it at config time, and you will be able to choose an external folder with appropriate permissions.

Upvotes: 2

Tryliom
Tryliom

Reputation: 109

Save it where the program is stored

Upvotes: 1

Related Questions