The blocking operations supported by this channel.
The blocking operations supported by this channel.
Closes this channel.
Closes this channel.
Puts this channel in blocking mode (if applicable) and performs a set of blocking operations.
Puts this channel in blocking mode (if applicable) and performs a set of blocking operations. Uses the standard ZIO
Blocking
service to run the provided effect on the blocking thread pool. Installs interrupt handling so that if
the ZIO fiber is interrupted, this channel will be closed, which will unblock any currently blocked operations.
Given a BlockingOps
argument appropriate for this channel type, produces an effect value containing blocking
operations.
Tells whether or not this channel is open.
Tells whether or not this channel is open.
Sets this channel's position.
Sets this channel's position. Setting the position to a value that is greater than the file's current size is legal but does not change the size of the file. A later attempt to read bytes at such a position will immediately return an end-of-file indication. A later attempt to write bytes at such a position will cause the file to be grown to accommodate the new bytes; the values of any bytes between the previous end-of-file and the newly-written bytes are unspecified.
The new position, must be >= 0
Returns the current value of this channel's position.
Returns the current size of this channel's file.
Attempts to acquire a lock on the given region of this channel's file.
Attempts to acquire a lock on the given region of this channel's file. This method does not block. An invocation
always returns immediately, either having acquired a lock on the requested region or having failed to do so. If it
fails to acquire a lock because an overlapping lock is held by another program then it returns None
. If it fails
to acquire a lock for any other reason then an appropriate exception is thrown.
The position at which the locked region is to start, must be >= 0
The size of the locked region; must be >= 0, and the sum position + size must be >= 0
true to request a shared lock, in which case this channel must be open for reading (and possibly writing); false to request an exclusive lock, in which case this channel must be open for writing (and possibly reading)
A channel for reading, writing, mapping, and manipulating a file.
Unlike network channels, file channels are seekable with a current position that can be changed. The inherited read and write methods that do not take a position operate at the current position and update the position based on the number of bytes actually read or written.