Can't write to a file on Linux server

Hello! So the problem I'm having is with dini. (I know, I know, it's slow and there are better alternatives. Wish I knew that before I based my whole saving system around it.) This line of code:
dini_IntSet("/save/frequencies.ini", PnameM, WTChannel[playerid]);
Works perfectly on a Windows hosted SA-MP server. The problem occurs when I run the script on a Linux system. It just doesn't save anything to the specified file, and I've no idea how to fix it. If you have any idea what might be causing the issue, I would greatly appreciate your help, thanks for taking a look!

Linux OP system is case sensitive check the file spelling and your code spelling both matching or not.

Also, make sure the file is writable and readable.

cd gamemode_path/scriptfiles/save
chmod g+wr frequencies.ini

I don't know if Dini uses absolute or relative filenames. If it's the first, you'd be writing outside of your home directory, where you likely don't have write permission.

Why would you want to use Dini, however? It has been proven to be slow and outdated countless times.

1.Linux is case sensitive, "./Directory/" and "./directory/" are NOT the same.
2.Watch out for linux path. Anything starting with / (slash) means root, not relative to where you are now. So use "/save/frequencies.ini" just in case samp does not handle that (i think it is but im not sure).
3.Directory must be writable. Make sure that you user/group has write rights for that directory. (Dont forget that if your user is owner of the directory, then group or everyone else rights are not meant for him.

Hello again! I'd like to thank everybody that provided some help! The problem was caused by the lack of write permissions, which I must have somehow overlooked.

Forum Jump:

Users browsing this thread: 1 Guest(s)