FEGetOpenFileInfo

Returns directory entry information for a given connection's file handle

Local Servers:blocking
Remote Servers:blocking
NetWare Server:4.x, 5.x, 6.x
Platform:NLM
Service:File Engine

Syntax

   #include <nwfileng.h>  
    
   int FEGetOpenFileInfo  (  
      LONG    connection,   
      LONG    handle,   
      LONG   *volume,  
      LONG   *directoryNumber,   
      LONG   *dataStream 
      LONG   *flags);
   

Parameters

connection

(IN) Specifies the connection number of the object that has the file open.

handle

(IN) Specifies the file handle for which to return volume or directoryNumber.

volume

(OUT) Points to the number of the volume on which the directory entry is located.

directoryNumber

(OUT) Points to the directory entry number of the entry.

dataStream

(OUT) Points to the data stream with which the handle is associated.

flags

(OUT) Points to the status of the handle (see Remarks section).

Return Values

See Return Values for C for more information.

0

Success

0xFF

Failure

Remarks

When given a connection number and a NetWare file handle, FEGetOpenFileInfo returns the information in the output parameters. The file handle for the handle parameter must be an OS file handle such as the fileHandle field returned in various FS Hooks return structures defined in nwfshook.h.

FEGetOpenFileInfo is useful if you are using FS Hooks because it gives the status/flags for an open file. However, keep in mind that fileHandle may not be populated by some callbacks—for example FSHOOK_PRE_OPENFILE if the file has not yet been opened. Also keep in mind that FEGetOpenFileInfo is a blocking function and cannot be used in a POST FS Hooks routine. In that case callback information would have to be passed to another routine to call FEGetOpenFileInfo.

The flags parameter is a composition of three fields from the file control block (FCB): flags, extraFlags, and extraExtraFlags (defined in fileio.h):

flags bits:

0x00000001

NotReadableBit

0x00000002

NotWritableBit

0x00000004

WrittenBit

0x00000008

DetachedBit

0x00000010

SwitchingToDirectFileSystemModeBit

0x00000020

DirectFileSystemModeBit

0x00000040

FileWriteThroughBit

0x00000080

HasFileWritePrivilegeBit

extraFlags bits:

0x00010000

DiskBlockReturnedBit

0x00020000

IAmOnTheOpenFileListBit

0x00040000

FileReadAuditBit

0x00080000

FileWriteAuditBit

0x00100000

FileCloseAuditBit

0x00200000

DontFileWriteSystemAlertBit

0x00400000

ReadAheadHintBit

0x00800000

NotifyCompressionOnCloseBit

extraExtraFlags bits:

0x01000000

IsWritingCompressedBit

0x02000000

HasTimeDateBit

0x04000000

DoingDeCompressionBit

0x08000000

NoSubAllocBit

0x10000000

IsATransactionFileBit

0x20000000

HasFileWritePrivilegeBit

0x40000000

TTSReadAuditBit

0x80000000

TTSWriteAuditBit