mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 2,127
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
tested in mIRC 6.21 and 6.16 and 6.17

//echo -a *** $isdir(c:\test)
*** $false
//mkdir c:\test
//echo -a *** $isdir(c:\test)
*** $true
//mkdir c:\test\ip
* /mkdir: unable to create 'c:\test\ip'
//echo -a *** $isdir(c:\test\ip)
*** $false
//echo -a *** $isdir(c:\test\ip\)
*** $true

This is the only special case i've found where $isdir requires the ending backslash, and it's strange that mkdir does create the c:\test\ip\ subfolder, even though the script bombs with an error message saying it didn't.

I tried with a few other subfolder names like longip or url or version without finding any other foldernames doing the same thing. c:\ip does the same thing.

<<EDIT: using XP >>

Last edited by maroon; 10/04/07 03:59 AM.
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Sounds like this is related to mIRC's handling of dir/file names that match windows device names.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It is, and it was reported earlier. You should be able to find some or all of the earlier report(s) by expanding the search range to the 5 year maximum and searching for the term "Windows Device" (since searching for IP doesn't work under the current forum configuration due to the number of characters in the search string)

Joined: Jan 2004
Posts: 2,127
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
I had tried searching, but I guess I wasn't doing it right. I was thinking the problem I encountered was related to IP being an mIRC keyword. I thought I recalled the problem with filenames being a device name prevented writing to them at all, and I was able to create ip.txt in a DOS window just fine.

I assume all devices are blocked because of the risk of allowing it with the wrong ones. For example I recall back in the 90s, I can't remember whether it was mIRC or a different chat client, where you could crash someone by inducing them to try to play clock$.wav

It just seems strange that with these special device names that $isdir requires the ending backslash on the path, but then mkdir allows you to create the foldername, yet bombs out with an error message saying it didn't do so.


Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I'm sorry if it sounded like I was implying that you hadn't searched. You've been around long enough that I know you know to search, I just wasn't sure if you'd used the default time settings (which for this isn't long enough) and/or weren't sure of a proper topic to search for, since IP won't work.

When using a DOS window, you are using DOS, which 'runs' under Windows, rather than 'on top' of Windows, as mIRC does. So when you created the IP.txt file using the DOS window, you were creating it at a level under that where the Windows device names are stored.

Joined: Dec 2002
Posts: 5,457
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,457
In general you should specify a final backslash if you are referring to a folder. The reason for this is that...

[snip]

Right, I had written an explanation about why this is happening but thinking about it a little more... :-) it probably makes sense to force $isdir() to automatically append a backslash to whatever you specify and treat it as a folder. Fixed for the next version.

Last edited by Khaled; 12/04/07 08:05 PM.
Joined: Feb 2006
Posts: 65
F
Babel fish
Offline
Babel fish
F
Joined: Feb 2006
Posts: 65
try that with nul,pnt(i think, u'll have to try differnt versions of that abv.) and aux.


known on irc as MrStonedOne
read my full post before replying or dont reply. tl;dr isn't allowed here
Joined: Jan 2004
Posts: 2,127
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Originally Posted By: RusselB
I'm sorry if it sounded like I was implying that you hadn't searched.

RusselB, I wasn't taking offense. And looking back on it, I probably put my search into the 2nd "name" box instead of the "keyword" box.

Originally Posted By: Khaled

[snip]
it probably makes sense to force $isdir() to automatically append a backslash to whatever you specify and treat it as a folder. Fixed for the next version.


Just wanted to mention that $isdir should append the backslash only if the existing argument isn't $null, ie:

/unset %asdfg
//echo -a $isdir(%asdfg)

... shouldn't be returning a true because $isdir(\) exists. Since $exists is used for both files and folders, I'm not sure what changes if any should be made for that function.


Link Copied to Clipboard