3 The PassWdHome Library

Notice! Notice: The PassWdHome library can only be used on unix-systems.

The PassWdHome library defines only one pattern, getPassWdHome that expand ~username to a absolute path.

3.1 Using the PassWdHome Fragment

A program using the getPassWdHome fragment will have the following structure:

INCLUDE '~beta/unixlib/passwdhome'
--- program: descriptor ---
(# ...
do ...
   '~bart' -> getpasswdhome -> putline;
   ...
#)

3.1.1 GetPassWdHome example

ORIGIN '~beta/unixlib/passwdhome';
-- PROGRAM: descriptor --
(# t: ^text
do
   'Enter text strings for home-directory expansion.' -> putline;
   'E.g. '\'~beta\'' will be expanded to the home directory' -> putline;
   'of the user called beta.' -> putline;
   'Stop expansion by entering an empty string' -> putline;
   loop: cycle
     (#
     do 'Homedir to get: ' -> putText;
        keyboard.getLine -> t[];
        (if t.length // 0 then leave loop
         else t[] -> getPasswdHome -> putLine;
        if);
     #);
#)


© 1990-2002 Mjølner Informatics
[Modified: Wednesday October 18th 2000 at 13:55]