File permissions for webapps

I’m making a simple app that stores some values on simple txt files, it’s just a few lines containing usage statistics (it’s a quiz game).
when I test locally everything works fine but on the server I’m getting very umpredictable behaviors on reading/writing these files.
After reading the dox I think it’s probably related to the file permissions since I’m testing on Windows while I deploy to the cloud so it’s 2 different OS.
(and coming from Windows I didn’t have a clue about permissions to begin with)

I need my app to read and write these files without restrictions, for all users, is this what I should add to the code ?

Method that creates the txtfile:

Dim f as FolderItem
f=new FolderItem(session.filestats,FolderItem.PathTypeNative)

#If TargetXojoCloud Then
f.Permissions = &o764

edit: by the way, what would be the default permission if you don’t set any in particular ?


The default depends on the system config, but they’re usually 644 and to be quite frank, you shouldn’t use 7 unless you’re making an executable file.

So what permissions do I need for simple reading and writing on a text file ?
f.Permissions = &o64

is it OK ? thanks

No. If you want read/write, use &o600. The first digit is User, second is Group, last is World (everyone). The values are combinations of:

Read = 4
Write = 2
Execute = 1

4 + 2 = Read + Write

Depending on where you are putting your app, you may need to be concerned with group & world, but if you are alone on the server and have sufficient intrusion protection, they won’t matter as much (because you’re only protecting from yourself).

My app doesn’t have the “right” to read and write by default ?

Total noob here with Linux permissions. bear with me