Main Menu

KB#00248-Error 0 when OPENing the same file using different naming conventions

Title:

Error 0 when OPENing the same file using different naming conventions

Description:

If the same file is OPENed twice under DOS, each OPEN must use the exact same path/filename. That is, you cannot OPEN it one with just the filename, and then again with the full path. For example, you could not do the following: 

open(1)"TEST.DAT" 
open(2)"Test.dat" 

as it would result in an error 0. However, if you attempt to OPEN it a third time, it may work. 

Resolution:

On single-user Visual PRO/5 products an !ERROR=0 occurs when a file open attempt is made to a file that was already opened on another channel, but the path to the file was different. For example: 

OPEN(1)"file" 
OPEN(2)"./file" 

The OPEN(2) will fail with an !ERROR=0. This has been corrected in P/5 Rev 1.05 through the use of a new SETOPTS bit. The new bit is Byte 7 Bit 1. When this bit is set, Visual PRO/5 behaves in the same manner as the PRO/5 Unix ports. For example: 

OPEN(1)"file" 
OPEN(2)"./file" 

will share the same FCB which prevents an extra user slot being taken on the file and the !ERROR=0 for single user product. The FID() information is that of channel 1 in this case. The file name reported at offset 9 in FID(2) is exactly the same as that of FID(1) (i.e. "file"). Had channel 2 been open first the file name info in the FID(1) would be "./file". As a result of this correction, multiple channels to the same opened file use a single FCB. 



Last Modified: 07/27/1998 Product: Visual PRO/5 Operating System: MS Dos WindowsError Number: 0

BASIS structures five components of their technology into the BBx Generations.

View BASIS LinkedIN Profile Visit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel