Hello, I have a problem with locking files. The following code will work on several OS but it seems to fail on FreeBSD giving an IOError. Any ideas? f = open('filename', 'w') fd = f.fileno() flock = struct.pack('2h8l', FCNTL.F_WRLCK, 0, 0, 0, 0, 0, 0, 0, 0, 0) fcntl.fcntl(fd, FCNTL.F_SETLKW, flock) Thanks Haris Lekatsas