home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nettos11.zip / BINDERY / MAILDIR.PRG < prev    next >
Text File  |  1993-02-23  |  2KB  |  81 lines

  1. /*
  2.  * File......: MAILDIR.PRG
  3.  * Author....: Glenn Scott
  4.  * CIS ID....: 71620,1521
  5.  * Date......: $Date$
  6.  * Revision..: $Revision$
  7.  * Log file..: $Logfile$
  8.  * 
  9.  * This is an original work by Glenn Scott and is placed in the
  10.  * public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log$
  16.  *
  17.  */
  18.  
  19.  
  20. /*  $DOC$
  21.  *  $FUNCNAME$
  22.  *     FN_MAILDIR()
  23.  *  $CATEGORY$
  24.  *     Bindery
  25.  *  $ONELINER$
  26.  *     Return the user's directory in SYS:MAIL
  27.  *  $SYNTAX$
  28.  *     
  29.  *     fn_mailDir( [<cUser>] ) -> cMailDir
  30.  *
  31.  *  $ARGUMENTS$
  32.  *
  33.  *    <cUser> is the user for which you want to find the mail directory.
  34.  *    Defaults to the current user.
  35.  *
  36.  *  $RETURNS$
  37.  *
  38.  *    <cMailDir>, a string containing the mail directory path, without
  39.  *    a trailing backslash ("\").
  40.  *
  41.  *  $DESCRIPTION$
  42.  *
  43.  *    When a user is created via SYSCON, SYSCON automatically creates
  44.  *    a directory for that user in SYS:MAIL\xxx, where "xxx" is a 
  45.  *    hexidecimal number representing that user's bindery object ID.
  46.  *    This call allows you a quick way to access that directory by
  47.  *    doing the bindery object ID lookup for you, as well as the 
  48.  *    hex conversion.
  49.  *
  50.  *    The user's personal login script (if she has one), is kept in 
  51.  *    this directory.
  52.  *    
  53.  *  $EXAMPLES$
  54.  *
  55.  *    The following is a complete login script editor.
  56.  *    
  57.  *        #include "netto.ch"
  58.  *        function scriptEd( cUser )
  59.  *           local cFile
  60.  *           default cUser to fn_whoami()
  61.  *           cFile := fn_maildir( cUser ) + "\login"
  62.  *           return memowrit(  cFile, memoedit( memoread( cFile ) ) )
  63.  *
  64.  *  $SEEALSO$
  65.  *
  66.  *  $INCLUDE$
  67.  *
  68.  *  $END$
  69.  */
  70.  
  71. #include "netto.ch"
  72.  
  73. function fn_mailDir( cUser )
  74.    local nObjID
  75.    default cUser to fn_whoami()
  76.  
  77.    nObjID := fn_gbndoid( cUser, OT_USER ) // Get object ID for user
  78.  
  79.    return "sys:mail\" + fn_bin2hex( l2bin( ft_lswap( nObjID ) ) ) 
  80.  
  81.