src/errno.bend checks
raw source on the hub · import ezsys@0.1.0.0/src/errno.bend as Errno
ezsys/src/errno: a file operation's failure written as Python writes an
OSError: [Errno N] <strerror>: <repr(path)>. The text of a code is
glibc's, from a table of common Linux codes; a code the table does not
list is written with the message it came with. The path is written as
Python's repr(str) writes it, for the characters up to U+00FF.
1 import
import Base
Definitions
def err.Table source · line 9 · raw
Data
the codes and their texts, reusable
def err.table source · line 13 · raw
err.Table
the common Linux codes and glibc's text for each, as os.strerror gives it
def err.when source · line 67 · raw
@hit:Bool -> @yes:(@_:Unit -> String) -> @no:(@_:Unit -> String) -> String
what is written when hit holds, else what the rest writes
def err.look source · line 75 · raw
@table:err.Table -> @+code:U32 -> @+why:String -> String
the text of the first pair with the code, or why when there is none
def err.text source · line 83 · raw
@+code:U32 -> @+why:String -> String
a code's text: the table's, or why when the table does not list it
def err.quote.pick source · line 87 · raw
@dq:Bool -> Char
the quote a path is written between: " when it holds a ' and no ", else '
def err.quote source · line 95 · raw
@+path:String -> Char
the quote repr picks for a path
def err.hexed source · line 101 · raw
@+cp:U32 -> Bool
the code points repr writes as \xhh: below U+0020, U+007F to U+00A0, and U+00AD
def err.hex.or source · line 107 · raw
@got:Maybe<&2, Char> -> Char
a digit's character, or '0' past the digits
def err.hex.digit source · line 115 · raw
@num:U32 -> Char
the lowercase hex digit of a number's last four bits
def err.hex2 source · line 119 · raw
@+cp:U32 -> String
two lowercase hex digits of a number's last eight bits
def err.ctl source · line 123 · raw
@+cp:U32 -> String
a control character: \t, \n, \r, or \xhh
def err.plain source · line 130 · raw
@+qt:Char -> @+cp:U32 -> String
any other character: a backslash or the quote escaped, else itself
def err.esc source · line 136 · raw
@+qt:Char -> @chr:Char -> String
one character of a path between the quote q
def err.go source · line 142 · raw
@+qt:Char -> @path:String -> String
a path's characters between the quote q
def err.repr source · line 150 · raw
@+path:String -> String
a path as Python's repr(str) writes it
def err.os source · line 155 · raw
@+code:U32 -> @+why:String -> @+path:String -> String
a failed file operation as Python's OSError writes it