flock icon indicating copy to clipboard operation
flock copied to clipboard

feat: add directory support

Open tharvik opened this issue 5 years ago • 1 comments

Followup of #39.

Comment from @theckman

I think to support this, at a minimum, we would need to move the OpenFile error handling code into the platform-specific flock.go files. To quote the proverbs: "Syscall must always be guarded with build tags."

So, I splitted setFh in the system specific files, that should do the trick. I'm unable to test for AIX but windows & linux pass the tests. I've keep the doubling of the main test suite, one with a file, another with a directory.

NB: on master, two examples in flock_example_test.go (namely ExampleFlock_TryLock & ExampleFlock_TryLockContext) are not being run, because of missing // Output: line.

tharvik avatar Oct 15 '20 00:10 tharvik

@tharvik working on seeing if I can get access to an AIX system to test this against.

theckman avatar Jun 27 '21 01:06 theckman