home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / view1212.zip / MAILDIR.PAS < prev    next >
Pascal/Delphi Source File  |  1991-08-22  |  794b  |  42 lines

  1. program maildir;
  2. {
  3.    21 Aug 91   Mark Bramwell.
  4.  
  5.    Allows you to quickly move into the mail directory of an user.
  6.    You must be on the SYS: volume, else a runtime error will occur.
  7.  
  8.  
  9.    F:\> maildir mbramwel
  10.  
  11.    F:\MAIL\D000001>
  12.  
  13.  
  14. }
  15.  
  16. uses novell;
  17.  
  18. var username : string;
  19.     hexid : string;
  20.     retcode : integer;
  21.     realname : string;
  22.  
  23.  
  24.  
  25. begin
  26. if paramcount = 0 then
  27.  begin
  28.  writeln('Please use ->   MAILDIR <username>');
  29.  halt;
  30.  end;
  31.  username := paramstr(1);
  32.  gethexid(username, hexid, retcode);
  33.  if retcode = 0 then
  34.  begin
  35.   get_realname(username,realname,retcode);
  36.   if realname = '' then realname := username;
  37.   writeln('Mail Directory for ',realname);
  38.   chdir('\mail\'+hexid);
  39.  end else
  40.  writeln('Could not find username -> ',username);
  41. end.
  42.