mIRC Homepage
Posted By: r00tb0y Unable to write to a file 'Global.hash' - 12/08/08 09:26 AM
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
Posted By: maroon Re: Unable to write to a file 'Global.hash' - 12/08/08 02:38 PM
mIRC won't attempt to write to devicename.* filenames. See https://forums.mirc.com/ubbthreads.php?ubb=showflat&Board=8&Number=175798
Posted By: r00tb0y Re: Unable to write to a file 'Global.hash' - 12/08/08 03:25 PM
and why does /hsave|/hload test global.hash.txt work?
write global.hash.txt doesn't.
Posted By: RoCk Re: Unable to write to a file 'Global.hash' - 12/08/08 03:29 PM

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.
Posted By: r00tb0y Re: Unable to write to a file 'Global.hash' - 12/08/08 03:34 PM
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)
Posted By: maroon Re: Unable to write to a file 'Global.hash' - 12/08/08 03:44 PM
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.
Posted By: RoCk Re: Unable to write to a file 'Global.hash' - 12/08/08 03:44 PM

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
Posted By: hixxy Re: Unable to write to a file 'Global.hash' - 14/08/08 12:30 AM
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.
Posted By: MTec007 Re: Unable to write to a file 'Global.hash' - 14/08/08 02:35 AM
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
-
Posted By: maroon Re: Unable to write to a file 'Global.hash' - 14/08/08 05:49 AM
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.
Posted By: MTec007 Re: Unable to write to a file 'Global.hash' - 14/08/08 06:55 AM
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."
© mIRC Discussion Forums