mIRC Home    About    Download    Register    News    Help

Print Thread
#55878 18/10/03 07:44 PM
Joined: Oct 2003
Posts: 313
S
Sais Offline OP
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
The following sequence would appear to be a bug:

*** START ***

//echo -a $exists(test.txt)
-> $false

/fopen -n TEST test.txt
-> * fopen created 'TEST' (F:\MIRC611\test.txt)

/fclose TEST
-> * fclose closed 'TEST' (F:\MIRC611\test.txt)

//echo -a $exists(test.txt)
-> $true

/fopen -n TEST test.txt
-> * fopen unable to create 'TEST' (F:\MIRC611\test.txt)

//echo -a $ferr
--> 1

//fwrite -n TEST test test test
--> * fwrite error writing to 'TEST'

/fclose TEST
-> * fclose closed 'TEST' (F:\MIRC611\test.txt)

*** END ***
According to the docs, "The -n switch creates the file if it doesn't already exist." This would suggest to me that it either opens it (if it exists) or it creates it (if it doesn't) - much as a POSIX standard interface would.

(This also appears to have been the assumption on a previous bug report ...)

(I'm using mIRC 6.12)

Last edited by Sais; 18/10/03 07:45 PM.

Sais
#55879 18/10/03 07:54 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
versions.txt v6.11
40.Changed /fopen behaviour, now fails if file doesn't exist. The
-n switch creates a new file, fails if it exists. And -o creates
a new file, overwrites if it exists.

The help file is not entirely correct.


Link Copied to Clipboard