fopen returns invalid handle after long server uptime -
SiripIkan - 29.01.2015
So, my server (Linux VPS) has a problem with fopen. After long time since server started (about 6 hours uptime or more), fopen starts to return invalid handle on every file even they all exist. This method:
pawn Код:
new File:open = fopen("(FILE NAME HERE)", io_write); //same thing happens on all filemode
if(open)
{
//File operation here
fclose(open);
}
Just keeps the server running with fopen not functioning until server restarts.
This problem made players data keep reset until I changed the saving system to SQLite. Even i've changed it, this problem still exists. And now the INSERT and UPDATE Query doesn't work after long time along with invalid fopen handle. it really frustating me D:
Can someone help me? thanks before.
Okay sorry for my bad English.
Solved
Quote:
Originally Posted by SiripIkan
Have checked it with FileEx Include and noticed a file handle doesn't get closed after being opened. This file always called when OnPlayerConnect() triggers.
After closing this file handle now the problem is gone.
Thanks all for helping, especially for Vince..
|
Re: fopen returns invalid handle after long server uptime -
ATGOggy - 29.01.2015
Linux is case sensitive so, "scriptfiles" and "Scriptfiles" is different in Linux.
Re: fopen returns invalid handle after long server uptime -
RedFusion - 29.01.2015
I've had this problem with linux hosts aswell, still no clue why it happens..
Re: fopen returns invalid handle after long server uptime -
SiripIkan - 30.01.2015
Bump..
Quote:
Originally Posted by ATGOggy
Linux is case sensitive so, "scriptfiles" and "Scriptfiles" is different in Linux.
|
the case is fine, file can be opened (with fopen) without problems but after long time it always return invalid handle until server restarts.
Re: fopen returns invalid handle after long server uptime -
Vince - 30.01.2015
Are you closing the files properly when you don't need them anymore? This is pure speculation, but it might just refuse to open any more files while any previous ones aren't properly closed.
Re: fopen returns invalid handle after long server uptime -
SiripIkan - 30.01.2015
Quote:
Originally Posted by RedFusion
I've had this problem with linux hosts aswell, still no clue why it happens..
|
What do you do when it happens?
Quote:
Originally Posted by Vince
Are you closing the files properly when you don't need them anymore? This is pure speculation, but it might just refuse to open any more files while any previous ones aren't properly closed.
|
Yes, i've checked all of my script. All file handles closed after being opened.
Re: fopen returns invalid handle after long server uptime -
RedFusion - 30.01.2015
Quote:
Originally Posted by SiripIkan
What do you do when it happens?
Yes, i've checked all of my script. All file handles closed after being opened.
|
Nothing special at all, it works just fine on all of the windows hosts i ever used. And i do close all of the valid file handles.
Re: fopen returns invalid handle after long server uptime -
SiripIkan - 31.01.2015
Bump..
Quote:
Originally Posted by RedFusion
Nothing special at all, it works just fine on all of the windows hosts i ever used. And i do close all of the valid file handles.
|
Hmm.. that's strange :/
Re: fopen returns invalid handle after long server uptime -
DRIFT_HUNTER - 31.01.2015
Since its a host, it may have limited read/write quotas...
Re: fopen returns invalid handle after long server uptime -
SiripIkan - 31.01.2015
Quote:
Originally Posted by DRIFT_HUNTER
Since its a host, it may have limited read/write quotas...
|
It could be the problem... But how to check it?