Plan B User's Manual
Name
- info Get the box information.
Synopsis
- #include <ulib.h>
void info(char* sel, Stat* st)
Description
- Each box has a some information, or metadata, attached to it. Info retrieves the information for a box with name and constraint given by sel, and places it in the st structure.
The Stat structure is defined as follows
- typedef struct Stat Stat;
struct Stat {
char kind[MAXKIND]; // box kind and constraints.
char owner[MAXUSER]; // who owns the box
char putter[MAXUSER];// who changed the box
long vers; // # of updates
long ptime; // last put time
long gtime; // last get time
long size; // size in bytes
short operm; // permissions for owner
short wperm; // permissions for world
};
kind is a string with both the box type and associated constraint separated by "!". It contains at least one item with the box type.
owner is a string with the name of the user who owns the box.
putter is a string with the name of the user who last changed the box.
ptime is the time of the last box change.
gtime is the time of the last box access.
size is the box size in bytes.
vers is the number of updates made to the box.
operm is the set of permissions for the owner.
wperm is the set of permissions for others.
Permissions are made of the following bits:
PGet Box contents can be accessed.
PPut Box contents can be changed.
PSel Selectors and info can be retrieved.
PLnk Another box can be linked to it.
PMk Inner boxes can be made.
PDel The box can be deleted.
PDeldie The box will be removed when the creator process dies.
PDeltmp The box will be removed if unused during a whole day.
PNcache The box will not be cached when used from remote locations.
Source
- /src/b/port/box.c
See also
- lb(1)
and chinfo(2).
Bugs
- If a process creates a box with PDeldie permission set and it is no longer connected to the machine hosting the box when it dies, the box is not removed.
Plan B User's Manual. First edition.