mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 117
R
Rich Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
$isfile(<existing file> $+ \) returns $true

Example:
Typing //echo -s $isfile($mircexe $+ \)
echoes $true


$input(Me like stars, You too?)
Joined: Feb 2003
Posts: 42
G
Ameglian cow
Offline
Ameglian cow
G
Joined: Feb 2003
Posts: 42
Just curious here.... When is this a problem?

Cheers,
GregMo

Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
when you want to $isfile a user given input which might end with \ by accident?

it's a bug indeed


If it ain't broken, don't fix it!
Joined: Feb 2003
Posts: 71
P
Babel fish
Offline
Babel fish
P
Joined: Feb 2003
Posts: 71
//echo $isfile($mircexe $+ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\////////////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\////////////////////////////////////////////////////////\\\\\\\\\\\\\\\\\\\)

Response: $True

The way $isfile works it treating still as a File path then a Folder path…


Kn0wledge Is Thee P0wer!!!!
Joined: Dec 2002
Posts: 117
R
Rich Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
I think all slashes and/or backslashes at the end of the filename are stripped before the actual check is performed.

Also, slashes and backslashes are treated exactly the same:
$isfile(c:\program files/mirc\mirc.exe/) returns $true (yes, I installed mirc there : )


$input(Me like stars, You too?)
Joined: Feb 2003
Posts: 71
P
Babel fish
Offline
Babel fish
P
Joined: Feb 2003
Posts: 71
It’s obvious now since I mentioned it, otherwise you would have been more specific in your first post. wink


Kn0wledge Is Thee P0wer!!!!

Link Copied to Clipboard