1 \chapter{Amoeba Specific Services
}
3 \section{Built-in Module
\sectcode{amoeba
}}
6 This module provides some object types and operations useful for
7 Amoeba applications. It is only available on systems that support
8 Amoeba operations. RPC errors and other Amoeba errors are reported as
9 the exception
\code{amoeba.error = 'amoeba.error'
}.
11 The module
\code{amoeba
} defines the following items:
13 \renewcommand{\indexsubitem}{(in module amoeba)
}
14 \begin{funcdesc
}{name_append
}{path\, cap
}
15 Stores a capability in the Amoeba directory tree.
16 Arguments are the pathname (a string) and the capability (a capability
18 \code{name_lookup()
}).
21 \begin{funcdesc
}{name_delete
}{path
}
22 Deletes a capability from the Amoeba directory tree.
23 Argument is the pathname.
26 \begin{funcdesc
}{name_lookup
}{path
}
27 Looks up a capability.
28 Argument is the pathname.
31 object, to which various interesting operations apply, described below.
34 \begin{funcdesc
}{name_replace
}{path\, cap
}
35 Replaces a capability in the Amoeba directory tree.
36 Arguments are the pathname and the new capability.
39 in the behavior when the pathname already exists:
41 finds this an error while
43 allows it, as its name suggests.)
46 \begin{datadesc
}{capv
}
47 A table representing the capability environment at the time the
48 interpreter was started.
49 (Alas, modifying this table does not affect the capability environment
52 \code{amoeba.capv
['ROOT'
]}
53 is the capability of your root directory, similar to
58 \begin{excdesc
}{error
}
59 The exception raised when an Amoeba function returns an error.
60 The value accompanying this exception is a pair containing the numeric
61 error code and the corresponding string, as returned by the C function
65 \begin{funcdesc
}{timeout
}{msecs
}
66 Sets the transaction timeout, in milliseconds.
67 Returns the previous timeout.
68 Initially, the timeout is set to
2 seconds by the Python interpreter.
71 \subsection{Capability Operations
}
73 Capabilities are written in a convenient
\ASCII{} format, also used by the
80 \bcode\begin{verbatim
}
81 >>> amoeba.name_lookup('/profile/cap')
82 aa:
1c:
95:
52:
6a:fa/
14(ff)/
8e:ba:
5b:
8:
11:
1a
86 The following methods are defined for capability objects.
88 \renewcommand{\indexsubitem}{(capability method)
}
89 \begin{funcdesc
}{dir_list
}{}
90 Returns a list of the names of the entries in an Amoeba directory.
93 \begin{funcdesc
}{b_read
}{offset\, maxsize
}
96 bytes from a bullet file at offset
98 The data is returned as a string.
99 EOF is reported as an empty string.
102 \begin{funcdesc
}{b_size
}{}
103 Returns the size of a bullet file.
106 \begin{funcdesc
}{dir_append
}{}
107 \funcline{dir_delete
}{}\
108 \funcline{dir_lookup
}{}\
109 \funcline{dir_replace
}{}
110 Like the corresponding
112 functions, but with a path relative to the capability.
113 (For paths beginning with a slash the capability is ignored, since this
114 is the defined semantics for Amoeba.)
117 \begin{funcdesc
}{std_info
}{}
118 Returns the standard info string of the object.
121 \begin{funcdesc
}{tod_gettime
}{}
122 Returns the time (in seconds since the Epoch, in UCT, as for POSIX) from
126 \begin{funcdesc
}{tod_settime
}{t
}
127 Sets the time kept by a time server.