diff --git a/libs/filer/filer.go b/libs/filer/filer.go index fcfbcea0..a748e1fd 100644 --- a/libs/filer/filer.go +++ b/libs/filer/filer.go @@ -7,13 +7,22 @@ import ( "io/fs" ) +// WriteMode captures intent when writing a file. +// +// The first 9 bits are reserved for the [fs.FileMode] permission bits. +// These are used only by the local filer implementation and have +// no effect for the other implementations. type WriteMode int +// writeModePerm is a mask to extract permission bits from a WriteMode. +const writeModePerm = WriteMode(fs.ModePerm) + const ( - OverwriteIfExists WriteMode = 1 << iota + OverwriteIfExists WriteMode = writeModePerm + 1<