home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / srev13h.zip / DIR.DOC < prev    next >
Text File  |  2001-05-02  |  16KB  |  342 lines

  1. 02 May 2001
  2.             !DIR: SRE-http's built-in directory display facility
  3.  
  4. I. Introduction 
  5.  
  6. !DIR is SRE-http's built in directory display facility.
  7. It has a number of display options, and can even automatically generate 
  8. "descriptions" of text documents.
  9.  
  10. !DIR is invoked in one of two ways:
  11.  i) By explicitily calling it with a selector of !DIR.
  12.     Example:  /!DIR?dir1
  13. ii) By the !CREATE option of AUTO_NAME; which instructs SRE-http to generate 
  14.     a directory listing "when there is no INDEX file".
  15.      Example: /dir1/    (assuming there is no "directory specific index file"
  16.                          in the DIR1 subdirectory)
  17.  
  18. Notes:
  19.  
  20.  * To improve performance, !DIR will "cache" directory listings;
  21.    which it will use (after checking for changes).
  22.  * For those interested in a more configurable directory display procedure,
  23.    we recommend SRE-http's GETAFILE addon (http://www.srehttp.org/apps/getafile).
  24.  
  25.                 --------------------------
  26.  
  27. II. Options
  28.  
  29. By default, !DIR displays a sorted directory listing with a
  30. descriptive icon, a filename (that links to the file), the creation date,
  31. and the size. A link when selected will be processed by SRE-http using 
  32. the standard rules (for example, it will be subject to selector-specific 
  33. access controls).
  34.  
  35. You can change these display options by modifying several SRE-http parameters:
  36.    DIR_EXCLUSION and DIR_OPTIONS.  
  37. You can also suppress display of selected directory (trees) by setting:
  38.   DIR_ACCESS and DIR_ACCESS_PRIVS
  39. (all four of these parameters are in INITFILT.80, and can be modified
  40. with the intermediate configurator).
  41.  
  42. When you use a !DIR selector, you can also include a list of options 
  43. in the selector (after a ?) --they will override the options specified
  44. in the DIR_OPTIONS parameter.
  45.  
  46. II.1. Descriptions of the DIR_ parameters:
  47.  
  48.   1) DIR_EXCLUSION: a space delimited  list of 'files and subdirectories'
  49.                     to exclude. Note that the * wildcard can be used.
  50.       Example: dir_exclusion='HTACCESS.  DESCRIBE.TXT /PRIVATE  *.CNT '
  51.  
  52.       Files and subdirectories listed in DIR_EXCLUSION will not be
  53.       displayed by !DIR.  However, the appearance of a directory
  54.       in DIR_EXCLUSION does NOT suppress display of the entire directory
  55.       (should it be the target of its own !DIR). 
  56.           For example,
  57.              if DIR_EXCLUSION='PRIVATE '
  58.              if D:\WWW is the default data directory, and it has
  59.                 D:\WWW\JOE, D:\WWW\JOE\PRIVAVE. D:\WWW\PETER,
  60.                 and D:\WWW\PETER\PRIVATE subdirectories,
  61.              then 
  62.                * a !DIR?JOE request will list all files and directories
  63.                  under d:\WWW\JOE, EXCCEPT for the PRIVATE directory.
  64.                * a !DIR?PETER request will list all files and directories
  65.                  under D:\WWW\PETER, EXCEPT for the PRIVATE directory.
  66.                * a !DIR?JOE/PRIVATE will list the contents of
  67.                  D:\WWW\JOE\PRIVATE
  68.  
  69.           Thus, a well-informed client can view the contents of 
  70.           an "excluded" directory (but will still be subject to 
  71.           access controls if she tries to download anything from it).
  72.  
  73.           * If you want to suppress "viewing the contents of"
  74.             D:WWW\JOE\PRIVATE (or D:\WWW\PETER\PRIVATE), use the
  75.             DIR_ACCESS options.
  76.  
  77.           
  78.   2) DIR_ACCESS and DIR_ACCESS_PRIVS
  79.      For extra security, you can use DIR_ACCESS to suppress display of 
  80.      selected directories. DIR_ACCESS should contain a space delimited list
  81.      of "selectors" that !DIR will limit access to.
  82.   
  83.    More precisely, each item in DIR_ACCESS is compared against the 
  84.    requested directory; and if any of them match (possibly using wildcards)
  85.    then the client must have one of the privileges listed in DIR_ACCESS_PRIVS
  86.    (or must be a SUPERUSER). If the client does not have one of these
  87.    privileges, !DIR will not display the directory.
  88.  
  89.         Example: DIR_ACCESS=' SYSTEM    */PRIVATE '
  90.                    Note that !DIR?JOE/PRIVATE would match */PRIVATE.
  91.                  DIR_ACCESS_PRIVS='SUPERUSER DIRPRIVS '
  92.  
  93.     For a further description, see INITFILT.DOC.
  94.  
  95.     Note: DIR_ACCESS and DIR_ACCESS_PRIVS are also used by the GETAFILE addon.
  96.  
  97.  
  98.   3)DIR_OPTIONS: A space delimited list  of display options, including:
  99.   
  100.     AUTO_DESCRIBE == Try to create descriptions. This is done by extracting
  101.                      <TITLE> and <META NAME="DESCRIPTION" Content="xx">
  102.                      headers from HTML files,  the -z comments or
  103.                      FILE_ID.DIZ files from .ZIP files, and the beginning of
  104.                      plain text files.
  105.  
  106.     DESCRIBE=filename.ext == Use one line descriptions that are contained
  107.                              in filename.ext. If just a DESCRIBE is included,
  108.                              the filename.ext is assumed to be DESCRIBE.TXT
  109.                              (see below for more details)
  110.  
  111.     DESC_LEN=nnn == Maximum characters to display in the description (ignored
  112.                     if neither DESCRIBE or AUTO_DESCRIBE options are included)
  113.  
  114.     DATEFMT=x == The date format used; where x is one of B C D E M N O S U W.
  115.              Where, given a date of 27 Aug 1988
  116.                 B:    725975
  117.                 D:    240
  118.                 E:    27/08/88
  119.                 L:    27 August 1988
  120.                 M:    August
  121.                 N:    27 Aug 1988
  122.                 O:    88/08/27
  123.                 S:    19880827
  124.                 U:    08/27/88
  125.                 W:    Saturday
  126.  
  127.            Note that if "x" is not one of these, N is used.
  128.  
  129.  
  130.     HEADERFILE=filename.ext == A file to use as a "header".  If no
  131.                                filename.ext is given, then DIR.HDR
  132.                                is looked for. See below for details.
  133.     FOOTERILE=filename.ext == A file to use as a "footer".  If no
  134.                                filename.ext is given, then DIR.FTR
  135.                                is looked for. See below for details.
  136.  
  137.     MULTI_SEND  == If the client's browser supports "Connection:Keep-Alive"
  138.                    (i.e.; NetScape 1.3), and the directory contains more then
  139.                    20 files, and AUTO_DESCRIBE will be attempted ..
  140.                    then MULTI_SEND instructs  !DIR to display
  141.                    "status" messages as the files are processed. These
  142.                    status messages (written after every 15 files) are
  143.                    sequentially displayed; and after all files have been
  144.                    processed, they will be overwritten by the directory
  145.                    listing.
  146.                    Note that older browsers (such as IBM's WebEx) do not 
  147.                    support "Connection:Keep-Alive"; !DIR will detect this 
  148.                    and not attempt to send status messages to such browsers.
  149.  
  150.     NOCACHE == If =1, Do NOT use the !DIR cache (force re-creation of the
  151.                directory listing)
  152.  
  153.     NOSIZE ==  If =1, Suppress display of size.
  154.     NOTIME ==  If =1, Suppress display of creation time
  155.     NODATE ==  If =1, Suppress display of creation time and date
  156.     NOICON ==  If =1, Suppress icon display
  157.     NOSORT ==  If =1, Suppress sorting (default is to sort by name)
  158.     NODIR  ==  If =1, Suppress subdirectory display (display files only)
  159.     NO_RECURSE_DIR == Do NOT Use DIR on subsequent directories.                 
  160.                     When NO_RECURSE_DIR=0, clicking on a directory
  161.                     link will yield a new !DIR style listing (using
  162.                     the current options). When NO_RECURSE_DIR=1,
  163.                     clicking on a directory link is treated as a
  164.                     standard request -- SRE-http will try to find
  165.                     a "directory specific" default file, and if
  166.                     it can't it might "automatically create a 
  167.                     directory listing"
  168.  
  169.                     Thus, if you want to use !DIR to examine the files in
  170.                     AND under a particular directory, you should set 
  171.                     NO_RECURSE_DIR=0.
  172.  
  173.     PATTERN==  Include only files that match this (possibly wildcard 
  174.                 containing) pattern.  You can have many PATTERN= elements.
  175.                     Example: PATTERN=*.HTM+PATTERN=*.DOC
  176.  
  177.  
  178.     PREFIX ==  Add a "special directive" before each element in the
  179.                list of file links.  Typically, this would be "SENDAS_CHECK_TYPE";
  180.                or one of the other "mime type modifiers".  Note that if your
  181.                forget to start the PREFIX with a !, one will be added.
  182.                    Example: PREFIX=!SENDAS_CHECK_TYPE
  183.  
  184.     SHOWPARENT ==  Allow client to go up to parent. This CAN be used with
  185.                    the NODIR option.
  186.     SIZEFMT=aaaaa == The size format: aaaaa=ABBREV means 13K,
  187.                                       aaaaa=0 means 13,012
  188.  
  189.     SORT=xxx   == Sort criteria. xxx can be one of:
  190.                       NAME -- Sort by name (the default)
  191.                       DATE -- Sort by date
  192.                       SIZE -- Sort by date
  193.                       DESCRIBE -- Sort using the order of entries in a DESCRIBE file.
  194.                                   Note that you MUST also specify a DESCRIBE option.
  195.                       EXT  --  Sort by extension
  196.                       NONE --  Do not sort. SORT=NONE has the same effect as NOSORT
  197.                 Note that SIZE and EXT are used, directories will be sorted by name.
  198.                 Also, if DESCRIBE is chosen and DESCRIBE file is not available, 
  199.                 or the DESCRIBE option is not specified, then sort by name is used.
  200.                
  201.     TABLE  == use an HTML TABLE to display (otherwise, use <PRE> formatting)
  202.     TABLE_BORDER=nnn  == Size of border (if table used). If nnn=0, then no
  203.                          border is shown.
  204.     TARGET=href_target == the "target window" -- if non-zero, a seperate window
  205.                           is used to display files (and directories) whose
  206.                           link is selected.
  207.     TIMEFMT=nn ==  The time format: nn=24 means use 13:01, nn=0 means  1:01p
  208.  
  209.  
  210.   Examples:
  211.      DIR_OPTIONS='notime describe no_recurse_dir datefmt=u nocache '
  212.      DIR_OPTIONS='showparent table auto_describe desc_len=300 multi_send '
  213.  
  214.  
  215. II.2. Specifying options in the selector.
  216.  
  217.   When invoking !DIR with a selector, you can append options
  218.   after the directory name (the directory name MUST immediately follow
  219.   the ?.  Seperate each option with a space (or a + if you are hand
  220.   coding a URL), and NOT with a &. The options are the same as above.
  221.  
  222.        For example:  /DIR?dir1+nosize+auto_describe
  223.  
  224.   Each of these options can be specified as is, or as option=0,
  225.   which "turns them off".  This =0 form is useful if you wish
  226.   to override a "parameter" settting with "request selector" option.
  227.   Alternatively, option=1 "turns them on" (note that turning on a
  228.   NOxxx option may mean suppressing a piece of the file info display).
  229.  
  230. II.3 Notes on the DESCRIBE option:
  231.  
  232.   * The description file (say, DESCRIBE.TXT) is assumed to be in the
  233.     "own directory". Thus, seperate directories must have their "own"
  234.     description file.
  235.  
  236.   * The DESCRIBE option expects a  "filename.ext" after an
  237.     = sign. If you leave this off, DESCRIBE.TXT is used (if available).
  238.     For example: !DIR?dir2+describe
  239.                 means "use the DESCRIBE.TXT file in the DIR2 subdirectory".
  240.  
  241.   * The description file (i.e.; DESCRIBE.TXT) file should be organized as
  242.       FILE1.xxx a description
  243.       file2.yyy  another description
  244.       /subdir1      a subdirectory description
  245.  
  246.   * Note that descriptions start with a file name (or a directory name,
  247.     which must be preceded by a /) followed by the description
  248.     (seperated from the filename by at least one space). These refer to
  249.     subdirectories of the request directory (for example, 
  250.     if D:\WWW is the default data directory, and !DIR?DIR2 is used,
  251.      the /SUBDIR1 refers to d:\www\dir2\subdir1)
  252.  
  253.   * The description must be on one (arbitrarily long) line. However, it will
  254.     be formatted to fit in the (possibly multi-line) display area.
  255.     This is in contrast with several SRE-http addons, which permit
  256.     multi-line descriptions.
  257.  
  258.   * When used with AUTO_DESCRIBE, if an explicit description is found
  259.     in the description file, it is always used. That is, AUTO_DESCRIBE
  260.     only applies to files that do NOT have an entry in the description file
  261.     (assuming the DESCRIBE option is used).
  262.  
  263.   * If you want to suppress all descriptions (!DIR is much faster when you
  264.     don't display descriptions), set AUTO_DESCRIBE=0 and DESCRIBE=0.
  265.  
  266.  
  267. II.4. Notes on the HEADERFILE and FOOTERFILE options.
  268.  
  269.   * The header-file and footer-file is assumed to be in the "own" directory.
  270.   * If a HEADERFILE is specified, and exists, the default
  271.     header is NOT written.
  272.     THUS.... If a HEADERFILE is specified, it MUST contain a <BODY>
  273.              element. In all likelihood, that's why you'ld use it
  274.              (so that you could specify a <BODY BACKGROUND=xxx.gif> element)!
  275.   * The HEADERFILE option expects a  "filename.ext" after an
  276.     = sign. If you leave this off, DIR.HDR is used (if available).
  277.     Similarly, if no file exists after the FOOTERFILE, a DIR.FTR file
  278.     is used (if available).
  279.  
  280.  
  281. II.5. Note on PATTERN= and DIR_EXCLUSION
  282.  
  283.    * DIR_EXCLUSION is a "can not match list".  PATTERN= entries, after
  284.      concatenation (nb: you can have multiple PATTERN= entries in your
  285.      option list) form a "must match list".  You can have both -- in
  286.      which case the file MUST match a PATTERN=, and must NOT match
  287.      a DIR_EXCLUSION element.
  288.   *  When invoking !DIR as a selector:
  289.          To override a PATTERN=xx.xx  that you've included in the DIR_OPTIONS;
  290.          just include a PATTERN=* option in the selector.
  291.          For example: /!DIR?PICTURES+PATTERN=*.JPG+PATTERN=INDEX.HTML
  292.  
  293.   * Reminder: DIR_EXCLUSION and PATTERN refers to files (and subdirectories) 
  294.               in a requested directory. DIR_ACCESS and DIR_ACCESS_PRIVS
  295.               refers to the requested directory itself. Thus, in order
  296.               for DIR_EXCLUSION and PATTERN to come into play, DIR_ACCESS
  297.               must first be satisfied.
  298.  
  299.                    --------------------------
  300.  
  301. III. Notes on caching
  302.  
  303.   * Caching is meant to be used in conjunction with the AUTO_DESCRIBE
  304.     and DESCRIBE=filename option. If you are not including descriptions,
  305.     then caching will probably not help a lot.
  306.  
  307.  *  A fairly simple caching algorithim is used, which will limit
  308.     the cache's usefulness if !DIR is used extensively.
  309.     If you intend to use !DIR extensively, you should consider
  310.     using the BBS addon.
  311.  
  312.   * Caching uses files that are stored in the TEMPDATA_DIR directory
  313.     (typically, \GOSERVE\TEMP).  A _DIR.IDX file is used as a reference
  314.     index, and _nnnnn.DSH files are used as "directory cache" files.
  315.  
  316.   * SRE-http will check the file-stamps of all files and subdirectories
  317.     in the requested directory.  In addition, it will check the
  318.     dir_option and dir_exclusion parameters.  If any of these have
  319.     changed, the cache entry will not be used.
  320.     Note: actually, a CRC of this information is used; thus, on very rare
  321.           occasions SRE-http will NOT detect a change.
  322.  
  323.   * The DIR_CACHE_DURATION and DIR_CACHE_SIZE variables (set in INIT_STA.80)
  324.     are used to set the size and lifespan of entries in the directory
  325.     cache.  The default values are 3 days and 1Megabyte.
  326.     Note that about once a day, !DIR will (when invoked) clean up
  327.     the directory cache (say, get rid of entries that have somehow
  328.     become orphaned).
  329.  
  330.   * To suppress, on a request specific basis, SRE-http's use of this
  331.     cache; just include a NOCACHE option in the request selector (using the
  332.     !DIR?dirname+NOCACHE syntax). To permanently suppress  it,
  333.     set DIR_CACHE_SIZE=0
  334.  
  335.    * Cache entries are identified by both fully qualified directory,
  336.      and by the "option list and exclusion" lists.
  337.      Thus, multiple views of the same directory may be cached.
  338.  
  339.                 --------------------------
  340.  
  341. :End of DIR.DOC.
  342.