Documentation ¶
Index ¶
Constants ¶
View Source
const ( // O_NONBLOCK flag tell some functions not to block. // Its value does not interfere with O_* constants from 'os' package. O_NONBLOCK = syscall.O_NONBLOCK )
Variables ¶
This section is empty.
Functions ¶
func FlagsForAccess ¶
FlagsForAccess extracts os.O_RDONLY, os.O_WRONLY, os.O_RDWR, and O_NONBLOCK flag values.
func FlagsForOpen ¶
FlagsForOpen extracts os.O_CREATE and os.O_EXCL flag values.
func IsTimeoutErr ¶ added in v0.3.0
IsTimeoutErr returns true, if the given error is a temporary syscall error.
func OpenOrCreate ¶
OpenOrCreate performs open/create file operation according to the given mode. It allows to find out if the object was opened or created.
creator is the function which performs actual operation. It is called with 'true', if it must create an object, and with false otherwise. It must return an 'not exists error' if the param is false, and the object does not exist. It must return an 'already exists error' if the param is true, and the object already exists. flag is the combination of open flags from os package. If flag == os.O_CREATE, OpenOrCreate makes several attempts to open or create an object, and analyzes the return error. It tries to open the object first.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.