•  Back 
  •  File functions 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File5.10.17  Flock                                                     TOS

 Name:         »File record locking« - Lock or unlock part of a file.

 Opcode:       92

 Syntax:       int32_t Flock ( int16_t handle, int16_t mode, int32_t 
               start, int32_t length );

 Description:  The GEMDOS routine Flock serves to protect portions of 
               a file from access by other processes. The following 
               apply:

                Parameter  Meaning

                handle     File ID
                mode
                            0 =     Apply lock
                            1 =     Remove lock
                start      Start position in the file
                length     Number of bytes affected

               Warning: This function is optional, hence the call may 
               return EINVFN as a reply. In particular, one should 
               note that Flock need not be available on all installed 
               file-systems.

 Return value: The function can return the following results:

                E_OK :     No error has arisen
                ELOCKED :  Overlapping portion of file already locked
                ENSLOCK :  Matching lock not found for removal

 Availability: Only present when '_FLK' cookie exists.

 Group:        File functions

 See Also:     Binding   Fcreate   Fopen   Fclose   Fdelete   Ptermres 
                 F_SETLK