Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Error 1077. File Open: Open Failed

Keywords:  Error 1077 File Open Failed 

General Question on FileOpen:

I'm getting the 1077: FileOpen: Openfailed error during the second Call() pass of the first line of code below. I suspect that the FileClose() command is not executing at all, but I'm not aware of anyway to detect a successful FileClose(), nor do I know how to resolve. I have attempted TimeDelay() thinking that maybe it was a speed problem, but that does not help either. Any suggestions would be greatly appreciated.
        handle=FileOpen(tmpscrnfile,"WRITE")
        FileWrite(handle,crntscrn)
        ; TimeDelay(15)
        FileClose(handle)

        ; tmpscrnfile is a string containing a fully
        ; qualified path and file name.
        ;
        ; crntscrn is a string containing up to
        ; 3072 characters.

Answer:

Question on FileOpen and Compiling:

I'm getting this error message, when trying to recompile an EXE after a minor change in the WBT file, which from all appearances should not have caused any problems. I'm trying to compile to a network drive. Why is this happening?

Answer:

When Compiler tries to compile a WBT, it compiles the file in memory, and then when it goes to write the EXE file, it will report this error message, "Error 1077. File Open: Open Failed," if the old EXE of the same name, and in the same path, is unwriteable.

It could be unwriteable for a couple of reasons:

  1. The EXE file is Read-Only; or
  2. There is a lock on the EXE file you are trying to write to; or
  3. The EXE is already executing. Compiler cannot write to a file that is currently active.
What to do? Change the target filename or target directory of the EXE file, in the third option in the main Compiler window. If you do this, and the compile is now successful, then you know that one of the conditions above exists, and you can now go about your business tidying things up.

Question on FileOpen and Directory Names with Spaces:

I'm getting a 1077 error when I try something like this (under NT 4.0). fubar is a file. It chokes on the space in the "program file" directory name.
        zgsTempDir = "g:\temp\program files\fubar"
        zlifh = fileopen(zgsTempDir,"WRITE")
The directory is accessible, no files are open, permissions are ok, etc.

I need to do this since there is no such function to convert LFN directories into SFN ones without having to first create a file in the directory then do a FileNameShort to that file.

Answer:

Winbatch can indeed handle long file names.

Are you using the 16 bit version of WinBatch??? The 16 bit version indeed cannot handle long files names. Only the 32 bit version can.


Article ID:   W12937
Filename:   1077 File Open Failed.txt