mIRC Home    About    Download    Register    News    Help

Print Thread
$isfile() for files that end with \ #10643 11/02/03 01:16 PM
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?)
Re: $isfile() for files that end with \ #10644 11/02/03 03:54 PM
Joined: Feb 2003
Posts: 42
G
GregMo Offline
Ameglian cow
Offline
Ameglian cow
G
Joined: Feb 2003
Posts: 42
Just curious here.... When is this a problem?

Cheers,
GregMo

Re: $isfile() for files that end with \ #10645 11/02/03 05:28 PM
Joined: Jan 2003
Posts: 1,063
D
Doqnach Offline
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!
Re: $isfile() for files that end with \ #10646 11/02/03 10:33 PM
Joined: Feb 2003
Posts: 71
P
Phant0m Offline
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!!!!
Re: $isfile() for files that end with \ #10647 13/02/03 04:31 PM
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?)
Re: $isfile() for files that end with \ #10648 13/02/03 06:23 PM
Joined: Feb 2003
Posts: 71
P
Phant0m Offline
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!!!!