mIRC Homepage
Posted By: Sais XP "bad" filename problem - 17/04/04 10:55 AM
This isn't a problem so much with mIRC, as with XP.

However, it does create a problem in mIRC - I noticed it when I created a network group called "Undernet:Proxy". mIRC then tried to create logfiles called:

#<channel>.Undernet:Proxy.<date>.log

(Although I have it set to create subdirectories for each network group...I assume it found it couldn't create the directory, and used a fallback filename format)

As we all know, ':' is an invalid character in a Windows filename, however mIRC was able to create the logfiles.

The rest of this post is mainly just to show the steps I have been through in confirming where the problem lies - in short there appears to be a problem with XP not returning an error when creating a file with a ':'. While it does appear to create the file, it does not list it correctly. The impact on mIRC is that in certain cases, such as my logfiles, you get some very strange results with $findfile(). Im my opinion it is something that needs to be remedies in Windows XP, not in mIRC, but it is something that people should be aware of. It might also be worth translating all the invalid filename characters in any logfile to '_', as is presently done with nicks.

Now for the search and debug steps (most people may wish to stop reading here!):

When I do:
//echo -a $chan(#).logfile
-> G:\mnj\mIRC\logs\#mIRC.Undernet:proxy.20040417.log

As you see, get the full filename.

//echo -a $isfile($chan(#).logfile)
-> $true

However:
//echo -a $findfile($nofile($chan(#).logfile), $chan(#).logfile,0)
-> 0

If I look in Windows Explorer, I have a file called '#mIRC.Undernet' (i.e. the filename up to the ':').

I can also create the file under plain DOS:

echo Wibble >test:test.txt

and it again gives me a file called "test" in a dir listing. However, if i try to get the contents using type test:test.txt or copy test:test.txt temp.txt, I get: The filename, directory name, or volume label syntax is incorrect.

But I can read it with cygwin's 'cat' if I use the full filename (but not the name that appears in the directory listing)

Posted By: Quietust Re: XP "bad" filename problem - 28/04/04 04:25 PM
Technically, : *can* be used in a filename under Windows NT, though what it really does is specify the STREAM you want to use. Google for "NTFS Streams" for more information.
© mIRC Discussion Forums