From owner-freebsd-questions Tue Mar 10 13:31:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA03793 for freebsd-questions-outgoing; Tue, 10 Mar 1998 13:31:15 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from serv01.net-link.net (serv01.net-link.net [205.217.6.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA03621 for ; Tue, 10 Mar 1998 13:30:15 -0800 (PST) (envelope-from wpub1@net-link.net) Received: from ricecake (pm201-27.bc.net-link.net [207.49.227.127]) by serv01.net-link.net (8.8.8/8.6.9) with SMTP id QAA32427 for ; Tue, 10 Mar 1998 16:30:09 -0500 Message-Id: <3.0.3.32.19980310163441.031536ec@smtp.net-link.net> X-Sender: wpub1@smtp.net-link.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.3 (32) Date: Tue, 10 Mar 1998 16:34:41 -0500 To: freebsd-questions@FreeBSD.ORG From: Matthew Hagerty Subject: open(), fopen(), and flock() Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greetings, Could someone tell me if you can use flock() to lock a file opened with fopen()? I have read some texts that say UN*X open() is not ANSI-C and to use fopen() is possible. Unfortunately every text I look in avoids concurrence like the plague and I cannot dig up much info on flock() (other than the man page). If flock() cannot be used with fopen(), then what do you use to lock a file opened with fopen()? Is there some reason to use fopen() over open() or vice/versa? Is there even any locking mechanisms in ANSI-C? Any insight would be greatly appreciated. Thank you. Matthew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message