Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: FileOpen 1077 Error with Webbatch
****************************** WebBatch Error 1077: FileOpen: Open failed hf = FileOpen(inifile, "READ") WebBatch 97C WIL Version: 2.4cbp ******************************I initialize "inifile" with this statement:
inifile = StrCat(DirHome(), "sbstat.ini")sbstat.ini is in the same directory with the webbatch script.
Here's my code fragment:
inifile = StrCat(DirHome(), "sbstat.ini") hf = FileOpen(inifile, "READ") outlistpath = FileRead(hf) FileClose(hf)(Note: I've examined 'inifile' and it contains the correct path+filename value)
This is running on an NT Workstation using Personal Web Server. the directory is on a fat drive... haven't tried this on a production nt server yet...
To force an ini file to disk do a:
I'm going to go ahead and try the webbatch script on a 'development' nt server (fresh environment) I've given the script directory (where this puppy & it's ini are located) 'Everyone Change', 'Administrators Full'. well see what happens -- keep you posted.
I'm not having any luck. besides the problem stated above (which still doesn't work) here's the real crux of the matter: I want to execute reskit utility pulist.exe from within my webbatch script, using redirection to generate an output file for examination of three tasks in particular. the problem seems to be with creating an output file.
The relevant code is:
outlist = 'out put file path' thisdata = 'set to server name' command = "pulist.exe \\%thisdata% >%outlist%" RunWait('cmd.exe', '/c %command%') if !FileExist(outlist) returncode = 1 return endifI'm getting a return code of 1. The outlist is in the script directory where this particular guy lives.
It's running under IIS 3.0. I've even tried putting the IUSR_servername account in the Administrator's group, no go.
I had to move the temporary file that I was creating and the parameter I was trying to read OUT of the directory that contained the .web file and into a directory elsewhere on the disk drive... interesting. NTFS permissions basically the same, go figure.
I am acquiring data from a form and need to write it out to an ascii file. Everything debugged good up to the point where I open the file for appending...
tablefile = FileOpen("table.dat", "APPEND") filewrite(tablefile,"%field1%")I double-checked the NTFS rights for generic visitors, (ok). I moved the file that I'm trying to write to another folder(?) as described in the solution mentioned above but got the same results.
What am I missing? Do I need to build a more specific path to "table.dat"?
It does not seem like you are into debugging the sharing problems that will come next.
But then when 80 million people start using it yuu start getting occassional errors in the FileOpen. "File could not be opened" or somesuch. What could be happening is that two (or more) copies of your script could be running at the same time (for two different users) and both of the scripts try to append to the file at the same time.
This is called a "resource conflict" and the solution is a "resource lock". The easiest solution is to use the file itself as the lock.
while 1 ; wait for resource to become avaiable ErrorMode(@off) tablefile = FileOpen("d:\right\there\table.dat", "APPEND") ErrorMode(@cancel) if tablefile!=0 then break ; resource lock obtained. exit loop TimeDelay(0.5) ; no? delay. try again in 1/2 second endwhile filewrite(tablefile,field1) FileClose(tablefile) ; Close file AND also free resource lock
Article ID: W12466
Filename: FileOpen 1077 Error with Webbatch.txt
File Created: 2017:07:28:12:58:11
Last Updated: 2014:06:17:12:57:59