Page 1 of 1 1
Topic Options
#70963 - 2002-10-21 03:05 PM Won't write to file. @error = 5
DarthBuck Offline
Fresh Scripter

Registered: 2002-10-20
Posts: 7
code:
? @error

$inventoryFile = "s:\LN_inventory\inventory.txt"

? @error

IF OPEN (2,$inventoryFile,5) = 0
$x = WriteLine (2, @FullName)
$x = CLOSE(2)
ENDIF

? @error

I am having problems opening a file to write to. I had a more elaborite script than this, but for trouble shooting I broke it all the way down to this.

The ? @error are in there for trouble shooting. The output when this script is ran is:
0
0
5
It will not create the file, it will not open and write to the file. This is about the most basic writeline I can come up with. Yes the S:\ drive is mapped and there are correct permisions to write to the directory.

The really weird thing is that it was working for a while. I was creating the script and testing it on two machines. Then I went to test it on a third machine before I put it in the login script and it didn't work. Now it won't work on any machine. All machines are Win2K SP2.

Can some one tell me what the problem is?

D.

Top
#70964 - 2002-10-21 03:10 PM Re: Won't write to file. @error = 5
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I would still look at share permissions.

anyway, to get the actual error place, do it like:

IF OPEN (2,$inventoryFile,5) = 0
? "opened:" @error
$x = WriteLine (2, @FullName)
? "writeline:" @error
$x = CLOSE(2)
? "close:" @error
ELSE
? "not opened:" @error
ENDIF
_________________________
!

download KiXnet

Top
#70965 - 2002-10-21 03:12 PM Re: Won't write to file. @error = 5
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
It may be a permissions thingy, as error level 5 is "access denied"

[ 21. October 2002, 15:13: Message edited by: Waltz ]
_________________________
We all live in a Yellow Subroutine...

Top
#70966 - 2002-10-21 03:14 PM Re: Won't write to file. @error = 5
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
checkout the UDF library: WriteLog2()

This code is already written for you. If you want to write your own, it can be used a guide.

[ 21. October 2002, 15:15: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#70967 - 2002-10-21 04:29 PM Re: Won't write to file. @error = 5
DarthBuck Offline
Fresh Scripter

Registered: 2002-10-20
Posts: 7
Thank all you for your help. Once again I am a bone head. It was access rights. The users had read but not write. Thanks again.

D.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 671 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.052 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org