Skip to content

Commit

Permalink
add rdrw open disk mode (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Ryzhenkov authored Apr 17, 2023
1 parent fd11a09 commit e29f8c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions diskfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ const (
ReadOnly OpenModeOption = iota
// ReadWriteExclusive open file in read-write exclusive mode
ReadWriteExclusive
// ReadWrite open file in read-write mode
ReadWrite
)

// OpenModeOption.String()
Expand All @@ -147,6 +149,8 @@ func (m OpenModeOption) String() string {
return "read-only"
case ReadWriteExclusive:
return "read-write exclusive"
case ReadWrite:
return "read-write"
default:
return "unknown"
}
Expand All @@ -155,6 +159,7 @@ func (m OpenModeOption) String() string {
var openModeOptions = map[OpenModeOption]int{
ReadOnly: os.O_RDONLY,
ReadWriteExclusive: os.O_RDWR | os.O_EXCL,
ReadWrite: os.O_RDWR,
}

// SectorSize represents the sector size to use
Expand Down

0 comments on commit e29f8c4

Please sign in to comment.