mIRC Home    About    Download    Register    News    Help

Print Thread
A
Anonymous
Unregistered
Anonymous
Unregistered
A
take any file, put TWO OR MORE spaces in a row in the name (anywhere). set a variable with its full path to make sure it has the double space. then try //if ($exists(%thefile)) { /dcc send <nick> %thefile } its going to pass the $exists but dcc send has a bug where it (most likely) truncates spaces for the purpose of sending the filename over irc. but it looks as if mirc uses the truncated name when it tries to load the file for sending, and you will get "unable to open file".

no crash, but it won't find the file. as you all know, mirc replaces multiple spaces with a single one. my guess is that it doesn't keep a separate reference to the original filename and when it tries to open the file to read data out of it, it uses the space-truncated name and can't find it. the result is "unable to open file"...

with regards,
chris

ps: for you smartasses who can't read instructions and quickly try a dcc send just to say "it works here"; you HAVE to put two or more spaces IN A ROW in the filename. that's when dcc send fails.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
i'm going to be a smarter ass and ask why anyone would put 2 or more spaces in a row, in the first place. wink mIRC isn't the only program to have trouble with this. That includes leading and trailing spaces in a filename.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
This is not a bug.

You can still send the file using $shortfn($findfile(dir,*file*name*,1)) to send it in 8.3 format. However, no mIRC command will allow multiple internal, leading or trailing spaces. Therefore, it's best simply to rename the file.

//var %filename = $replace($findfile(dir,*file*name*,1),$chr(32),>) | rename $shortfn($replace(%filename,>,$chr(32)) $+(",$nofile(%filename),$gettok($nopath(%filename),1-,32),")

and then send it normally.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
A
Anonymous
Unregistered
Anonymous
Unregistered
A
I'm going to be a smarter ass and ask why anyone would put 2 or more spaces in a row, in the first place. mIRC isn't the only program to have trouble with this. That includes leading and trailing spaces in a filename.
--------------
Yes it is, very much so. Multiple spaces in a row is not an illegal filename trait. And as such, if mirc can't internally handle a reference to the actual non-truncated filename and read the data from there instead, then it is very much a bug. I don't know why Hammer can't realize that and won't justify him with an answer. Although I WILL thank him for a temporary solution by using the 8.3 name.

With Regards,
Chris


Link Copied to Clipboard