Subj : massive confusion on file locks To : candycane From : Digital Man Date : Thu Aug 10 2023 09:30 am Re: massive confusion on file locks By: candycane to All on Thu Aug 10 2023 12:01 pm > Hi! > Does anyone have any good recourses to learning how to make file locks in c? File locks aren't really a "c" thing, but there is a POSIX standard and then there's the detailed differences in implementation on *BSD versus Linux versus Windows. For an example cross-platform abstraction/wrapper of different file and recording locking methods in C, see https://gitlab.synchro.net/main/sbbs/-/blob/master/src/xpdev/filewrap.c > I've been trying to research it but there's not many recourses out there > weirdly. I'm also very confused on the difference between flock(2) and fcntl > locks. If you want to lock an *entire* file, use flock(). If you want to lock just a *region* of a file, use fcntl(). -- digital man (rob) Synchronet "Real Fact" #43: Synchronet added Baja/PCMS support with v2.00a (1994) Norco, CA WX: 66.8øF, 94.0% humidity, 5 mph SE wind, 0.00 inches rain/24hrs .