mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2003
Posts: 37
C
cgfiend Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Mar 2003
Posts: 37
I'm returning nothing when I search the correct path for a long filename with spaces in it. It's an exact filename.ext, but still I get nothing. Any ideas? If someone has an alternative method please post it. I've noticed some of the file handling identifiers are extremely finicky.

on *:TEXT:@Mytrigger*:*:{
var %t,%u
%t = $remove($1-,@Mytrigger $+ $chr(32))
echo Searching %t
%u = $findfile(g:\ogg,$+(",%t,"),0,/echo $1- found.)
echo Done.
}

Joined: Dec 2002
Posts: 787
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 787
That looks like something thats being used for "illegal purposes" but for the benefit of the doubt, using $+(",%t,") requires for you to entire the ENTIRE filename and extension for it to find it, use *'s might be better.

Also, instead of using, $remove($1-,@Mytrigger $+ $chr(32))

Simply use, $2- to get the entire 'sentence' except the first word

Eamonn.

Joined: Mar 2003
Posts: 37
C
cgfiend Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Mar 2003
Posts: 37
Now why would you make an accusation like that without knowing what it's going to be used for? I'm working on a file queueing system that works off of the hard drive--not some text list of files. I wanted a search function to look for files and an option to add them to a queue for playing. All of my own music collection are in OGG form. Thanks for your input tho. The $2- totally slipped my mind. It comes from many years of BASIC programming.

Back to my routine... I've already specified that I am giving it a filename with an extension. It doesn't work. Even if i use * in any position around the variable as a wildcard, including the extension. No dice. Anyone? There has to be some reason long filenames aren't being found. %t stores something like "ZZTop - Greatest Hits - 01 - Song Name.ogg". You'd think $findfile would be able to find it. I gave it a path. Doesn't it search subsequent folders automatically?

Joined: Dec 2002
Posts: 787
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 787
I didnt acuse you of anything, just merely stating.

mIRCs' $findfile does infact search subdirectories as well however by comparison, 'ZZTop - Greatest Hits - 01 - Song Name.ogg' is not a long filename so i'm not sure exactly whats happening.. make sure also that there are no doublespaces or more, just single spaces between characters.

Try the following see what it returns, i'll list all the files in the DIR: //echo -> $findfile([color:red]dirhere[color:green],*,0,echo - $1-)

Joined: Mar 2003
Posts: 37
C
cgfiend Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Mar 2003
Posts: 37
I've been successful using wildcards to get a list of files using $filefind, but when I give it a specific filename it chokes. I was giving an example. The filenames I were using were a bit longer and varied from being in the "long filename" range to not a long filename. I've tried multiple lengths, but it still won't work for some reason. I may end up having to just make a list file after all and parsing it. $filefind sure isn't being cooperative. I did create such a script that used a list file and searched it, but it just seems tedious to do it that way and you'd have to refresh the list all the time. I'd rather use the hard drive directly if possible.

Joined: Dec 2002
Posts: 787
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 787
Did you check for doublespacings in the filenames?

Joined: Mar 2003
Posts: 37
C
cgfiend Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Mar 2003
Posts: 37
Yes. I used multiple filenames in my test and I verified, no double spaces.

(edit)

Oddly enough, upon a few slight changes and experimentation it start working. I tried everything I could think of before and now it works with a few simple changes:

on *:TEXT:@Mytrigger*:*:{
var %u
echo Searching $2-
%u = $findfile(g:\ogg,* $+ $2-,0,/echo $1-)
echo Done.
}

Last edited by cgfiend; 20/07/04 08:13 PM.

Link Copied to Clipboard