My app is giving this error at startup only on the first time it is run at each workstation. The second time it is started, it runs fine. It's writing to a file on a local drive.
Date : 12/28/15
Time : 09:10:56
Procedure : DC_PRINTER:INIT
Line Number : 596
Information : Error BASE/4
Description : Operating system error
Operation : set
Thread ID : 1
Source :
Called from : (B)INIT: _DCINIT(28)
Called from : DC_PRINTER:INIT(596)
Called from : DC_PRINTERON(3621)
Called from : STARTUP(370)
Called from : MCP(100)
Called from : MAIN(48)
This is the line of code:
BATFILE := "C:\POS\Z"+ALLTRIM(STR(G_STORENUM))+".BAT"
DCPRINT ON TEXTONLY OUTFILE (BATFILE) OVERWRITE
Suggestions?
OS error when trying to write to a file
Re: OS error when trying to write to a file
TEXTONLY mode uses the old Clipper style SET PRINTFILE TO <x>.
I don't know why this fails the first time.
Maybe a TEMP folder is needed.
Have you checked to see if a TEMP or TMP folder gets created?
Does the C:\POS folder already exist before running the first time?
I don't know why this fails the first time.
Maybe a TEMP folder is needed.
Have you checked to see if a TEMP or TMP folder gets created?
Does the C:\POS folder already exist before running the first time?
The eXpress train is coming - and it has more cars.
Re: OS error when trying to write to a file
The C:\POS folder is most definitely there. Is there another method to do the same thing that I could use as a workaround?
Re: OS error when trying to write to a file
Hi,
Write it with low level functions. There is also a memowrit() function, but this may have problems with the eof character.
Write it with low level functions. There is also a memowrit() function, but this may have problems with the eof character.
Code: Select all
BATFILE := "C:\POS\Z"+ALLTRIM(STR(G_STORENUM))+".BAT"
cText := "Whatever you need in your bat file."
abomemowrite(batfile,cText)
function abomemowrite(cTargetFile,cBuffer)
******************************************
Local nTarget := FCreate( cTargetFile, FC_NORMAL )
if nTarget == -1
return .F.
else
FWrite( nTarget, cBuffer)
FClose(ntarget)
endif
return .T.
Re: OS error when trying to write to a file
Thanks, Chris!
Re: OS error when trying to write to a file
I was going to suggest that too, however I think that TEXT INTO is more appropriate for this project.Write it with low level functions.
Code: Select all
BATFILE := "C:\POS\Z"+ALLTRIM(STR(G_STORENUM))+".BAT"
TEXT INTO cText WRAP
This is all of
the stuff that
I want in my batch
file.
ENDTEXT
abomemowrite(batfile,cText)
The eXpress train is coming - and it has more cars.