delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/22/08:27:19

From: "Rafał Maj" <r_maj AT poczta DOT onet DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: RE : flock under djgpp?
Date: Tue, 22 Aug 2000 13:23:29 +0200
Organization: Academic Computer Center CYFRONET AGH
Lines: 21
Message-ID: <8ntnvd$ok9$1@info.cyf-kr.edu.pl>
References: <39A2514A DOT 24857DC6 AT pt DOT nce DOT sita DOT int>
NNTP-Posting-Host: d-94-53-12.cyfronet.krakow.pl
X-Trace: info.cyf-kr.edu.pl 966943533 25225 149.156.1.172 (22 Aug 2000 11:25:33 GMT)
X-Complaints-To: news AT cyf-kr DOT edu DOT pl
NNTP-Posting-Date: 22 Aug 2000 11:25:33 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Użytkownik Bauce <bauce AT pt DOT nce DOT sita DOT int> wrote :
>   I'm trying to find a "file locking" function, and it seems that the
> "traditional" flock() is not available under djgpp.

 #include <io.h>
 int lock(int fd, long offset, long length);

Locks a region in file FD using MS-DOS file sharing interface.  The
region of LENGTH bytes, starting from OFFSET, will become entirely
inaccessible to other processes. If multiple locks are used on a single
file they must be non-overlapping. The lock must be removed before the
file is closed.

This function will fail unless SHARE, or a network software providing
similar interface, is installed. This function is compatible with
Borland C++ function of the same name.




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019