SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 11/02/2018, 04:23 PM   #11
iKarim
Gangsta
 
iKarim's Avatar
 
Join Date: Oct 2015
Posts: 588
Reputation: 135
Default Re: Ini files not being written

Quote:
Originally Posted by matje View Post
Code:
#define USER_PATH "/Users/%s.ini"

This might be the issue, try removing the first slash, so it becomes:

PHP Code:
#define USER_PATH "Users/%s.ini" 
The reason is, Linux systems handle the trailing / differently, in Linux the path becomes /Users/whatever.ini when there's a trailing slash while it's supposed to be /path/to/scriptfiles/Users/whatever.ini.
iKarim is offline   Reply With Quote
Old 11/02/2018, 04:24 PM   #12
Mugala
Gangsta
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: behind u
Posts: 646
Reputation: 30
Default Re: Ini files not being written

Quote:
Originally Posted by matje View Post
Even if the permissions were incorrect, why would it create a file then but not write to it?
some hostings have a permission to create a file but haven't a permission for edit this file.
__________________
here to help
Mugala is offline   Reply With Quote
Old 11/02/2018, 04:29 PM   #13
iKarim
Gangsta
 
iKarim's Avatar
 
Join Date: Oct 2015
Posts: 588
Reputation: 135
Default Re: Ini files not being written

Quote:
Originally Posted by Mugala View Post
some hostings have a permission to create a file but haven't a permission for edit this file.

That is incorrect. The write permissions are necessary for "touch" (creating files), you can't create a file with read only permissions.
iKarim is offline   Reply With Quote
Old 11/02/2018, 04:32 PM   #14
matje
Little Clucker
 
Join Date: Sep 2016
Posts: 19
Reputation: 0
Default Re: Ini files not being written

Quote:
Originally Posted by iKarim View Post
This might be the issue, try removing the first slash, so it becomes:

PHP Code:
#define USER_PATH "Users/%s.ini" 
The reason is, Linux systems handle the trailing / differently, in Linux the path becomes /Users/whatever.ini when there's a trailing slash while it's supposed to be /path/to/scriptfiles/Users/whatever.ini.
Unfortunately, no luck. I've opened a ticket to their support team, but I doubt they will be able to help me. Thanks anyways
matje is offline   Reply With Quote
Old 12/02/2018, 02:39 PM   #15
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,484
Reputation: 451
Default Re: Ini files not being written

Quote:
Originally Posted by matje View Post
Unfortunately, no luck. I've opened a ticket to their support team, but I doubt they will be able to help me. Thanks anyways
To make absolutely sure it isn't the script you could try to write a file using SAMP's original file functions:

Code:
new File:testfile = fopen("Test.txt", io_write);
fwrite(testfile, "Test");
fclose(testfile);
If this doesn't work, it is definitely a misconfiguration or an issue with the server.
I don't think there is a bug in Y_Ini after all this time but it's worth a try.

Also make sure that all cases are correct. Linux is case-sensitive while Windows isn't.
NaS is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can not see what written in the chat noamch1997 Scripting Help 5 10/08/2014 03:28 PM
Worst code you've written RajatPawar Discussion 24 13/07/2014 06:05 PM
What if SA-MP was written in...? ACI Everything and Nothing 56 19/03/2014 07:22 AM
What language was SA written in? glbracer Everything and Nothing 4 07/04/2013 07:12 PM
[Tool/Web/Other] JSA-MP - SA-MP library written in Java. Faab234 Tools and Files 8 17/07/2011 09:54 AM


All times are GMT. The time now is 01:55 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.