Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#os4units]

DosOpen

Open a file for input or output

Declaration

Source position: amigados.pas line 2428

function DosOpen(

  const Name: PChar;

  AccessMode: LongInt

):LongInt;

Arguments

Name

  

Name of file to opem

AccessMode

  

Access mode for file (MODE_*)

Description

The named file is opened and a file handle returned. If the accessMode is MODE_OLDFILE, an existing file is opened for reading or writing. If the value is MODE_NEWFILE, a new file is created for writing. MODE_READWRITE opens a file with an shared lock, but creates it if it didn't exist.

The name can be a filename (optionally prefaced by a device name), a simple device such as 'NIL:', a window specification such as 'CON:' or 'RAW:' followed by window parameters, or '*', representing the current window.

If the file cannot be opened for any reason, the value returned will be zero, and a secondary error code will be available by calling the routine IoErr().

See also

DosClose

  

ChangeMode

  

Change the current mode of a lock or filehandle

NameFromFH

  

Get the name of an open filehandle

ParentOfFH

  

Returns a lock on the parent directory of a file

ExamineFH

  

Gets information on an open file


Documentation generated on: 2021-07-30