mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2006
Posts: 4
R
r00tb0y Offline OP
Self-satisified door
OP Offline
Self-satisified door
R
Joined: Nov 2006
Posts: 4
Hi all,

i wrote a script and got an error on this small snippet:
//hadd -m test 1 1 | hsave test global.hash
* /hsave: unable to open 'F:\mirc\global.hash'

same on:
/write global.hash test
* /write: unable to open file

'global.hash.txt' is allowed.

any reason for that?
edit: tested on Mirc 6.2-6.34

r00tb0y

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
mIRC won't attempt to write to devicename.* filenames. See https://forums.mirc.com/ubbthreads.php?ubb=showflat&Board=8&Number=175798

Joined: Nov 2006
Posts: 4
R
r00tb0y Offline OP
Self-satisified door
OP Offline
Self-satisified door
R
Joined: Nov 2006
Posts: 4
and why does /hsave|/hload test global.hash.txt work?
write global.hash.txt doesn't.

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

They both work here with the .txt extension because there is a program associated with the .txt extension, but there is no program associated with .hash.

Joined: Nov 2006
Posts: 4
R
r00tb0y Offline OP
Self-satisified door
OP Offline
Self-satisified door
R
Joined: Nov 2006
Posts: 4
you didn't read what i wrote:
works: hsave test global.hash.txt
doesn't: write global.hash.txt test
doesn't: echo $isfile(global.hash.txt)

Last edited by r00tb0y; 12/08/08 03:35 PM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
i'm not sure why /write'ing to global.hash.txt would fail, unless "global.hash" is a device name for you. I was able to /write to that filename ok. mIRC is treating everything after the final period as the extension, not everything after the first period, so it sees the filename as global.hash.extension not global.extension.

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

I did read what you wrote, and I responded "They both work here"

It created and wrote to the file here, but $isfile and $read seem to be the ones failing rather than the /write command.

mIRC 6.34 on XP Pro

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
global.hash.txt works fine here, because the filename is 'global.hash' and not 'global' - not sure why it doesn't work on your end.

Joined: Feb 2007
Posts: 234
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
didnt work for me either. mirc 6.34, xp home sp2 etc.

//hadd -m test 1 1 | hsave test global.hash
* /hsave: unable to open file 'E:\PortableApps\mIRC\global.hash'
-
/write global.hash test
* /write: unable to open file
-

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
i think part of the strangeness that rootboy's referring to is that, while it is true that mirc won't /write to global.any_extension - if you do:

/write global.hash.txt test

you can go out to win-explorer and see that the file actually *DID* get created. However 6.34 tells you that

//echo -a $isfile(global.hash.txt)

is $false instead of $true

Perhaps $isfile is parsing the filename differently than /write is.

In case it helps track down the peculiarity, 6.32, 6.33 and 6.34 all allow writing to global.hash.txt, but 6.33 incorrectly gave a false message that it failed to write to the file, even though all 3 versions can.

Joined: Feb 2007
Posts: 234
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
by typing these commands, it WILL write on my machine: (Notice the FILE name)

//hadd -m test 1 1 | hsave test global.hash.
/write global.hash. test

it will actually write "global.hash" and NOT "global.hash."

Last edited by MTec007; 14/08/08 06:56 AM.

Link Copied to Clipboard