|
Joined: Dec 2002
Posts: 1,536
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2002
Posts: 1,536 |
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
|
|
|
|
Joined: Mar 2003
Posts: 1,256
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,256 |
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.
|
|
|
|
Joined: Dec 2002
Posts: 1,536
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2002
Posts: 1,536 |
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
|
|
|
|
Joined: Mar 2003
Posts: 1,256
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,256 |
All I can say is that it works fine on my end.
|
|
|
|
Joined: Dec 2002
Posts: 1,536
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2002
Posts: 1,536 |
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
|
|
|
|
Joined: Dec 2002
Posts: 1,536
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2002
Posts: 1,536 |
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
|
|
|
|
Joined: Dec 2002
Posts: 103
Vogon poet
|
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.
|
|
|
|
Joined: Mar 2003
Posts: 1,256
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,256 |
Strange that I do get em returned alphabetically. Always have.
|
|
|
|
r0ck0
|
r0ck0
|
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.
|
|
|
|
Joined: Jan 2003
Posts: 2,125
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,125 |
$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.
|
|
|
|
r0ck0
|
r0ck0
|
Well done
|
|
|
|
Joined: Dec 2002
Posts: 1,536
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2002
Posts: 1,536 |
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
|
|
|
|
r0ck0
|
r0ck0
|
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.
|
|
|
|
Joined: Dec 2002
Posts: 1,536
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2002
Posts: 1,536 |
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
|
|
|
|
|