Code Monkey home page Code Monkey logo

Comments (3)

fhs avatar fhs commented on June 6, 2024 1

I'll be sending a PR for Plan 9 support soon.

It's not really possible to implement Lock/Unlock using the "exclusive use" bit:

Per http://man.cat-v.org/plan_9/5/stat: “Exclusive use files may be open
for I/O by only one fid at a time across all clients of the server. If a
second open is attempted, it draws an error.”

Since Lock is called on an open file, if we can't open a locked file in the first place, we never even get into the Lock function to wait for the file to be unlocked by the other client. I think go-billy will need to use an API similar to the lockedfile package to support file locking on Plan 9.

I got all the tests passing on Plan 9, but I found that running go test ./... hangs in TestTempFileMany and TestTempFileManyWithUtil if we're using test cache. This is possibly a go tool bug. If I run the tests with go test -count 1 ./... everything passes.

from go-billy.

mcuadros avatar mcuadros commented on June 6, 2024

will be great if you can do a PR

from go-billy.

fhs avatar fhs commented on June 6, 2024

@henesy I think Lock is supposed to block until it acquires the lock (the posix implementation doesn't use LOCK_NB with flock). Maybe we can do something similar to the lockedfile package used by cmd/go.

Go's internal/filelock package does not support Plan 9.

from go-billy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.