fopen & fclose
#1

Hello,

I do have a question about some scenarios:

PHP код:
stock write(exmapletext[])
{
    new 
File:file fopen(pathio_append);
    
fwrite(fileexmapletext);
    
fclose(file);
    return 
1;

i open the file and close it at the end, is it even necessary to close it or will it be closed anyways when the variable isn't needed anymore?

So would that be exactly the same?

PHP код:
stock write(exmapletext[])
{
    new 
File:file fopen(pathio_append);
    
fwrite(fileexmapletext);
    return 
1;

and what happens if i just open it like that:

PHP код:
stock write(exmapletext[])
{
    
fopen(pathio_append);
    return 
1;

will the file still be opened but unaccessable after the function has been used?
Reply


Messages In This Thread
fopen & fclose - by BiosMarcel - 24.02.2016, 08:28
Re: fopen & fclose - by K0P - 24.02.2016, 08:48
Re: fopen & fclose - by BiosMarcel - 24.02.2016, 08:51
Re: fopen & fclose - by K0P - 24.02.2016, 08:55
Re: fopen & fclose - by BiosMarcel - 24.02.2016, 09:09
Re: fopen & fclose - by Threshold - 24.02.2016, 09:24
Re: fopen & fclose - by BiosMarcel - 24.02.2016, 11:47

Forum Jump:


Users browsing this thread: 1 Guest(s)