mIRC Home    About    Download    Register    News    Help

Print Thread
#48627 11/09/03 08:08 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
Ok, Im not understanding something. If I type //echo $findfile($sound(mp3),*.mp3,1) I get a file that is NOT the first file in an alphabetized list NOR is it the first file put on this system of that type. How does $findfile figure out what the first file is? What I guess Im not understanding is why $findfile doesnt just list the first one in a alphabetized list IF all the files of "X" type are in "Y" directory. *shrug*


Those who fail history are doomed to repeat it
#48628 11/09/03 10:01 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
You must be doing something wrong. $findfile(path,filespecs,N) browses through the specified path alphabetically, then moves through the subdirectories alphabetically. On my system it works fine. N=1 returns the 1st file, N=2 the 2nd etc. Remember that $sound(mp3) returns the directory you set in your options, which means it won't search your entire HDD for mp3 files.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#48629 11/09/03 10:09 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
If I do that EXACT command [//echo $findfile($sound(mp3),*.mp3,1)], the file that gets listed is actually the 39th file in the directory. If I change the 1 (one) to 39, I'll get listed the file that's really #95. Yes, I do remember that $sound will use the specified dir which is why I used it; so I wouldnt have to type out the actual path and could use that identifyer. I even tried typing in the path name manually and it STILL does the same thing. As far as I know it always has (on my systems) though I havent used previous systems for this specific thing so it could be a system specific issue, but Im just totally buggered on this one


Those who fail history are doomed to repeat it
#48630 11/09/03 10:18 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
All I can say is that it works fine on my end.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#48631 11/09/03 10:21 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
It doesnt here and hasnt for a few versions of mirc (for me). Ive been using this for a few versions of mirc and I cant explain why this happens which is why I asked in the first place. *wonders if it's an OS issue - or my PC being a POS*

EDITED - I tried it with a firend of mine who's using 98 (Im using 95b) and we duplicated this same thing. he got a file listed that is nowhere near #1 in an alphabetized list tho we're BOTH using scripts. Im going to download a fresh copy of mirc, instal it CLEAN (no previous settings) and try the exact same code and will reply to this msg with the results...... just damned peculiar

Last edited by landonsandor; 11/09/03 10:40 AM.

Those who fail history are doomed to repeat it
#48632 11/09/03 10:49 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
same exact thing with a totally clean instal of mirc to a brand new dir and everything. This is just damned peculiar


Those who fail history are doomed to repeat it
#48633 11/09/03 11:38 AM
Joined: Dec 2002
Posts: 103
Vogon poet
Offline
Vogon poet
Joined: Dec 2002
Posts: 103
This is how $findfile works. It doesn't return files in an alphabetical order. I never found out what ordering it was. I'm guessing natural ordering (i.e. however the underlying programming calls work). But who knows, maybe its ordered by date created or modified.

#48634 11/09/03 01:47 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Strange that I do get em returned alphabetically. Always have.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#48635 11/09/03 01:50 PM
Joined: Jun 2003
Posts: 242
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
I'm not really sure how it sorts either ... maybe by creation time or last access time, but I do know that $findfile sorts differently depending on the file system used. I'm currently using NTFS and $findfile sorts files differently (alphabetically I believe) with it than with FAT.

Last edited by r0ck0; 11/09/03 01:52 PM.
#48636 11/09/03 05:47 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
$findfile() calls a winapi function, FindNextFile(), and outputs the filenames in the same order as this function does. Quoted from this page:

The order in which this function returns the file names is dependent on the file system type. With NTFS and CDFS file systems, the names are returned in alphabetical order. With FAT file systems, the names are returned in the order the files were written to the disk, which may or may not be in alphabetical order.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#48637 11/09/03 05:52 PM
Joined: Jun 2003
Posts: 242
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
Well done smile

#48638 12/09/03 01:43 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
and yet THAT order is NOT the order Im being given either. Ive got files that were accessed before others showing up before AND after others as well as onmes newer than others showing up before and after older ones. I tried messing round with some stuff and in 6.1 it SEEMS that it wants to sort them in reverse order but places some of my "A" files throughout the listing and in reverse order (Z - A)


Those who fail history are doomed to repeat it
#48639 12/09/03 02:13 AM
Joined: Jun 2003
Posts: 242
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
Actually it says "With FAT file systems, the names are returned in the order the files were written to the disk"
It did not say returned in the order the files were last accessed

Last edited by r0ck0; 12/09/03 02:14 AM.
#48640 12/09/03 03:09 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
what *I* was saying is that most of the time there didnt appear to be ANY real order (including last accessed) to it sometimes but then other times it SEEMED to do a reverse alphabetical sort shoving some of my files starting with an "A" throughout the listing


Those who fail history are doomed to repeat it

Link Copied to Clipboard