Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - fbreopen() duplicate the handle of an open file http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 fbreopen()          Duplicate the handle of an open file
------------------------------------------------------------------------------
 Declaration
   fileio.hdr

 Syntax
   func _HFILE fbreopen extern
   param value _HFILE hFile

 Arguments
   hFile is the handle of the file to manipulate.

 Return
   A new file handle.

 Description
   fbreopen() duplicates the file handle of an open file, passed in the
   hFile parameter. If there are no more handles available, the return
   value will be -1, similar to fbopen().

   All handles associated with a file use the same file pointer. Duplication
   of file handles does not influence the open mode of the file.

 Example
   #define EXAMPLE_FILE
   #include example.hdr

   proc Test_fbreopen
   vardef
      _HFILE hFile1, hFile2
   enddef
   if fbopen( hFile1, "c:\autoexec.bat", FB_READ )
      hFile2 := fbreopen( hFile1 )
      ? hFile1, hFile2
      fbclose( hFile1 )
   endif
   endproc

   proc main
   Test_fbreopen()
   endproc

See Also: fbclose() fbopen()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson