This subclass of the core File
class adds the "tryopen" singleton method for opening files. A single "tryopen" and check for the return value may be used to avoid unnecessary stat(2) syscalls or File.open exceptions when checking for the existence of a file and opening it.
Kgio::File.tryopen(filename, [, mode [, perm]]) -> Kgio::File or Symbol source
Returns a Kgio::File
object on a successful open. filename
is a path to any file on the filesystem. If specified, mode
is a bitmask of flags (see IO.sysopen) and perm
should be an octal number.
This does not raise errors for most failures, but installs returns a Ruby symbol for the constant in the Errno::* namespace.
Common error symbols are:
:ENOENT
:EACCES
See your open(2) manpage for more information on open(2) errors.
Parent: File
Included modules: mPipeMethods
Pages
Classes
Methods
mail archives: https://yhbt.net/kgio-public/ http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/kgio-public/ nntp://news.public-inbox.org/inbox.comp.lang.ruby.kgio nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.lang.ruby.kgio public: kgio-public@yhbt.net source code: git clone https://yhbt.net/kgio.git torsocks git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/kgio.git