Skip to content

Conversation

rminnich
Copy link
Contributor

@rminnich rminnich commented Jul 2, 2025

No description provided.

@willscott
Copy link
Owner

I don't understand either of these changes

  • first commit resubmits Add plan 9 support for osFileInfo #141 which you haven't justified
  • second commit does not apply to truncate, and I can't find any documentation for why the 'exclusive' bit in opening a file is an issue in plan 9

Signed-off-by: Ronald G Minnich <rminnich@gmail.com>
@rminnich
Copy link
Contributor Author

rminnich commented Jul 3, 2025

ah, file_other.go was not there when I wrote file_plan9.go

As for O_EXCL, I see the actual problem:
linux:
" In general, the behavior of O_EXCL is undefined if it is used without O_CREAT. There is one ex‐
ception: on Linux 2.6 and later, O_EXCL can be used without O_CREAT if pathname refers to a block
device. If the block device is in use by the system (e.g., mounted), open() fails with the error
EBUSY."

Plan 9: O_EXCL only makes sense for create.

The flags currently are: os.O_WRONLY|os.O_EXCL

I don't think it even makes sense to use O_EXCL at all here, but on Plan 9 you get an error, and on linux you don't.

I think just dropping O_EXCL completely may be the proper fix. But the combination of os.O_WRONLY|os.O_EXCL gets an error on Plan 9.

rminnich added 2 commits July 9, 2025 09:25
Lots of programs (including git) do an Lstat to test
file existence. This can produce a lot of not-very-useful
spew. Just return nil for this error.

This makes the package more usable.

Signed-off-by: Ronald G Minnich <rminnich@gmail.com>
Exclusive over NFS has always been a dicey situation,
and failing breaks lots of things for which it is
mainly best-effort (e.g. git); if it does not work,
that is ok.

Print a warning message, but continue with the operation.

Signed-off-by: Ronald G Minnich <rminnich@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants