a1200   NEWS   APPS   DOCS   ABOUT
a1200
----
a1200
----
Autodocs
 Libraries:
 dos.library
  AbortPkt
  AddBuffers
  AddDosEntry
  AddPart
  AddSegment
  AllocDosObject
  AssignAdd
  AssignLate
  AssignLock
  AssignPath
  AttemptLockDosList
  ChangeMode
  CheckSignal
  Cli
  CliInitNewcli
  CliInitRun
  Close
  CompareDates
  CreateDir
  CreateNewProc
  CreateProc
  CurrentDir
  DateStamp
  DateToStr
  Delay
  DeleteFile
  DeleteVar
  DeviceProc
  DoPkt
  DupLock
  DupLockFromFH
  EndNotify
  ErrorReport
  ExAll
  ExAllEnd
  ExNext
  Examine
  ExamineFH
  Execute
  Exit
  FGetC
  FGets
  FPutC
  FPuts
  FRead
  FWrite
  Fault
  FilePart
  FindArg
  FindCliProc
  FindDosEntry
  FindSegment
  FindVar
  Flush
  Format
  FreeArgs
  FreeDeviceProc
  FreeDosEntry
  FreeDosObject
  GetArgStr
  GetConsoleTask
  GetCurrentDirName
  GetDeviceProc
  GetFileSysTask
  GetProgramDir
  GetProgramName
  GetPrompt
  GetVar
  Info
  Inhibit
  Input
  InternalLoadSeg
  InternalUnLoadSeg
  IoErr
  IsFileSystem
  IsInteractive
  LoadSeg
  Lock
  LockDosList
  LockRecord
  LockRecords
  MakeDosEntry
  MakeLink
  MatchEnd
  MatchFirst
  MatchNext
  MatchPattern
  MatchPatternNoCase
  MaxCli
  NameFromFH
  NameFromLock
  NewLoadSeg
  NextDosEntry
  Open
  OpenFromLock
  Output
  ParentDir
  ParentOfFH
  ParsePattern
  ParsePatternNoCase
  PathPart
  PrintFault
  PutStr
  Read
  ReadArgs
  ReadItem
  ReadLink
  Relabel
  RemAssignList
  RemDosEntry
  RemSegment
  Rename
  ReplyPkt
  RunCommand
  SameDevice
  SameLock
  Seek
  SelectInput
  SelectOutput
  SendPkt
  SetArgStr
  SetComment
  SetConsoleTask
  SetCurrentDirName
  SetFileDate
  SetFileSize
  SetFileSysTask
  SetIoErr
  SetMode
  SetOwner
  SetProgramDir
  SetProgramName
  SetPrompt
  SetProtection
  SetVBuf
  SetVar
  SplitName
  StartNotify
  StrToDate
  StrToLong
  SystemTagList
  UnGetC
  UnLoadSeg
  UnLock
  UnLockDosList
  UnLockRecord
  UnLockRecords
  VFPrintf
  VFWritef
  VPrintf
  WaitForChar
  WaitPkt
  Write
  WriteChars
Include
GuruMeditation
Docs » Autodocs » dos.library » LockRecord

NAME

	LockRecord -- Locks a portion of a file (V36)

SYNOPSIS

	success = LockRecord(fh,offset,length,mode,timeout)
D0 D1 D2 D3 D4 D5
BOOL LockRecord(BPTR,ULONG,ULONG,ULONG,ULONG)

FUNCTION

	This locks a portion of a file for exclusive access.  Timeout is how
long to wait in ticks (1/50 sec) for the record to be available.
Valid modes are:
REC_EXCLUSIVE
REC_EXCLUSIVE_IMMED
REC_SHARED
REC_SHARED_IMMED
For the IMMED modes, the timeout is ignored.
Record locks are tied to the filehandle used to create them. The
same filehandle can get any number of exclusive locks on the same
record, for example. These are cooperative locks, they only
affect other people calling LockRecord().

INPUTS

	fh      - File handle for which to lock the record
offset - Record start position
length - Length of record in bytes
mode - Type of lock requester
timeout - Timeout interval in ticks. 0 is legal.

RESULT

	success - Success or failure

BUGS

	In 2.0 through 2.02 (V36), LockRecord() only worked in the ramdisk.
Attempting to lock records on the disk filesystem causes a crash.
This was fixed for V37.

SEE ALSO

LockRecords(), UnLockRecord(), UnLockRecords()

Comments

Name:
E-mail: Use this if you want a message if you get a response, will not be shown.
Comment:
Select correct short for:

Crystal

RBS
ANA
CSL
DJ

Comments:

$VER: d0.se 1.14 Copyright © 2011-2024 Tobias Geijersson support at d0 dot se