mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 2,127
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Using newest beta in Win7-32. I was trying to confirm the /help file saying "If too many files are selected, $msfile() returns -1."

To recreate:

1. Created a subfolder beneath $sysdir(downloads) and copied 200 files into it.
2. Type: //echo -a $msfile(c:\that-path\)
3. Click into the dialog to set focus, then use Control-A to select all files
4. Click 'open' and it echoes the count of selected files.
5. I then copied a few files into the folder and repeated #2-4 each time I added a few more files.
6. Once the filecount reached around 216 it crashed mIRC.

Code:
//mkdir crash | bset &a -1 0 | var %a 1500 | while (%a) { bwrite -c crash\file.txt $+ %a -1 -1 &a | dec %a } | echo -a $msfile(crash\)



Wims tested it and he didn't crash with 216 files, but he did crash with 1500. So I retested with the above command, and it didn't crash until i increased the filecount to around 360. So the difference might be different memory levels or shorter filenames.

Joined: Dec 2002
Posts: 5,420
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,420
Thanks for your bug report. This issue has been fixed for the next version.

Joined: Jan 2004
Posts: 2,127
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Thanks. Look like the new beta fixes the crash by limiting the number of selected files to a lower count, possibly related to longer filenames. The above test alias limits me to around 93 files out of the 1500 selected, and in another folder with longer filenames the limit was in the 50s.

The $msfile behavior doesn't seem to match /help where it says "If too many files are selected, $msfile() returns -1."

Is there a case where $msfile(dir) now returns -1?

I take this to mean that "//echo -a $msfile($mircdir)" will return the same number as also filled into $msfile(0) except when there are too many files selected where the former returns -1 and the latter returns the file count.

However when I go to a folder having 7000 files in it, and use Control-A to select them all, $msfile(dir) and $msfile(0) both returned 40 - probably a lower total due to much longer filenames.


Link Copied to Clipboard