mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2003
Posts: 3
D
DogFood Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Sep 2003
Posts: 3
Hi, im working on a file searching script, and it returns full paths to mirc, thus using more than what mirc allows, is there a way to work around this problem?

function gets called and returns:
a:\kjfh,jfhljd\fdjkfdg\77493847\file.txt
b:\kjfh,jfhljd\fdjkfdg\77493847\file.mrc
c:\kjfh,jfhljd\fdjkfdg\77493847\file.fdf
d:\kjfh,jfhljd\fdjkfdg\77493847 \file.doc
e:\kjfh,jfhljd\fdjkfdg\77493847 \file.nfo

Any Ideas?

Joined: Jun 2003
Posts: 195
N
Vogon poet
Offline
Vogon poet
N
Joined: Jun 2003
Posts: 195
filenames are limited to the constant MAX_PATH wich is 256. 900 is way more than that. for individual files this should be enough. if your trying to fill the data variable with multiple files i would recomend against it. alternatively you can use a custom alias or signal wich is called once for each file. this allows you to send multiple files with just one call and still remain under 900. you cannot alter the data variables size (realloc wont work because mirc expects it to be 900 so it wont use anything above that. also the pointer returned from realloc is not garaunteed to be the same altho there is a workaround for that).


Have Fun smile
Joined: Sep 2003
Posts: 3
D
DogFood Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Sep 2003
Posts: 3
Problem is the function returns multiple filenames and relative paths

Joined: Jun 2003
Posts: 195
N
Vogon poet
Offline
Vogon poet
N
Joined: Jun 2003
Posts: 195
then most likely youll want to take advantage of the mapped file ability and call an alias or signal passing in each filename found.


Have Fun smile
Joined: Oct 2003
Posts: 38
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Oct 2003
Posts: 38
also, if you REALLY want to pass all the files in the returned value, you might try replacing text in the files with identifiers such as $mircdir. you can use SendMessage with file mapping (look up SendMessage in mIRCs helpfile if you are unsure of what i mean) to evaluate identifiers suck as $mircdir. This would only apply if the files are within mIRCs dir though. also using the short filename as opposed to the long filename will aslo save you some length. even so you should still use custom signals rather than this method because there is no gaurantee that this list will be less than 900 chars.


-TheXenocide
ParseMPopup
Joined: Feb 2003
Posts: 307
T
Fjord artisan
Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
try to put it in a binvar


Link Copied to Clipboard