log manipulation with low level IO primitives + lockf