mIRC Home    About    Download    Register    News    Help

Print Thread
Unable to write to a file 'Global.hash' #203332 12/08/08 09:26 AM
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

Re: Unable to write to a file 'Global.hash' [Re: r00tb0y] #203343 12/08/08 02:38 PM
Joined: Jan 2004
Posts: 1,617
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,617
mIRC won't attempt to write to devicename.* filenames. See http://forums.mirc.com/ubbthreads.php?ubb=showflat&Board=8&Number=175798

Re: Unable to write to a file 'Global.hash' [Re: maroon] #203345 12/08/08 03:25 PM
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.

Re: Unable to write to a file 'Global.hash' [Re: r00tb0y] #203346 12/08/08 03:29 PM
Joined: Dec 2002
Posts: 2,025
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,025

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.

Re: Unable to write to a file 'Global.hash' [Re: RoCk] #203347 12/08/08 03:34 PM
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.
Re: Unable to write to a file 'Global.hash' [Re: r00tb0y] #203348 12/08/08 03:44 PM
Joined: Jan 2004
Posts: 1,617
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,617
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.

Re: Unable to write to a file 'Global.hash' [Re: r00tb0y] #203349 12/08/08 03:44 PM
Joined: Dec 2002
Posts: 2,025
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,025

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

Re: Unable to write to a file 'Global.hash' [Re: r00tb0y] #203393 14/08/08 12:30 AM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
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.

Re: Unable to write to a file 'Global.hash' [Re: hixxy] #203395 14/08/08 02:35 AM
Joined: Feb 2007
Posts: 234
M
MTec007 Offline
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
-

Re: Unable to write to a file 'Global.hash' [Re: MTec007] #203402 14/08/08 05:49 AM
Joined: Jan 2004
Posts: 1,617
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,617
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.

Re: Unable to write to a file 'Global.hash' [Re: maroon] #203403 14/08/08 06:55 AM
Joined: Feb 2007
Posts: 234
M
MTec007 Offline
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.