home *** CD-ROM | disk | FTP | other *** search
/ Amiga Times / AmigaTimes.iso / programme / trionbbs110 / Trion / docs / 04_File_sections.doc < prev    next >
Encoding:
Text File  |  1998-10-06  |  11.7 KB  |  344 lines

  1.  
  2.  
  3.   Introduction
  4.   ------------
  5.  
  6.    This chapter is a description of the Trion BBS file system.
  7.    The file system is what lets the user list files, mark files
  8.    and download or upload files.
  9.  
  10.  
  11.   File catalogue format
  12.   ---------------------
  13.  
  14.    For the system to be able to show lists of files it needs
  15.    to maintain a file catalogue.
  16.    The file catalogue is stored (default) in the directory
  17.    "trion:filecat/" but this can be changed by editing the
  18.    TrionRM.cfg configuration file (see chapter 3).
  19.  
  20.    The file catalogue actually consists of a number of files,
  21.    a set of files for each section and a "GlobalIndex.dat" file.
  22.    Each section has 3 files.
  23.    A "FileData.N" file, a "Description.N" file, and a "KeyIndex.N"
  24.    file.   (where 'N' is the number of the section)
  25.  
  26.    The FileData files contain the actuall information on files,
  27.    like name, size, upload date, number of downloads etc.
  28.    All the entries in this file have the same (fixed) size,
  29.    this is usefull because when a file entry has to be updated
  30.    because it was for instance downloaded or the validated
  31.    flag was set only a tiny part of the file has to be changed.
  32.    Also this is necessary because the position of the file entry
  33.    can't be changed or the KeyIndex and GlobalIndex file pointers
  34.    are not valid anymore. This also means that there is no specific
  35.    order to the files, a new file is stored over deleted ones or
  36.    appended to the end of the file.
  37.  
  38.    Because of fixed size format of the FileData files there is no
  39.    place for (long) descriptions .. so they are stored in the
  40.    Description files. The descriptions are stored in the same
  41.    order as the files in the FileData files. So they are
  42.    easy to match to the file entries. Every entry in the
  43.    FileData files has a "pointer" to the description file
  44.    so it knows where it's description is.
  45.    When a description file was accidently changed or edited, for instance
  46.    one line has gotten shorter or longer, then the pointers no longer match
  47.    with the descriptions in that section. This can be fixed by
  48.    running the "RMcommander" program.
  49.  
  50.    The KeyIndex files contain the sequence of the files in Alphabetical
  51.    and chronological order.
  52.    They are needed for the BBS to know in what order to list files.
  53.    When you lost any KeyIndex files, you can remake them with
  54.    the "RMcommander" program.
  55.  
  56.    Every file has an entry in the file catalogue with a lot of
  57.    information .. but also every file has a short entry in the
  58.    globalindex, this is needed for very quick access to the file
  59.    catalogue if it has to be downloaded or if there has to be checked
  60.    if a file exists yet (while uploading for instance) .. because the file
  61.    is sorted on name and the TrionRM has an index in memory of 
  62.    the characters the names start with, it can get the
  63.    position in the file catalogue of the file in a split second.
  64.    When you have lost the GlobalIndex file, or you are
  65.    removing file sections you have to remake the GlobalIndex with
  66.    the "RMcommander" program.
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.   User access capabilities
  74.   ------------------------
  75.  
  76.    The access a user has to a file section is defined in the "template"
  77.    that is connected to his level. Templates are defined in the
  78.    templates.cfg and described in chapter 3.
  79.  
  80.    In a template, lines with sections ranges with the same access flags
  81.    are listed. Like this:
  82.  
  83.     FileAccess  [VLDU---]   , 1 , 3-5 , 6-9 , 12-14 , 20-35 , 60-73
  84.     FileAccess  [V--U---]   , 2
  85.  
  86.     (with 'All' you can use all areas with the given flags, same
  87.      effect as 1 - 65536)
  88.  
  89.    At the moment there are 7 flags for file sections:
  90.  
  91.     View List Download Upload Freedownload Edit Newfilesvisible
  92.  
  93.    Where the flags have the folowing meaning:
  94.  
  95.    V = View,         User sees area in Lists and can go to this area.
  96.    L = List,         User can Browse and FileList through this area.
  97.    D = Download,     User can Download from this area.
  98.    U = Upload,       User can Upload in this area.
  99.    F = Freedownload, This area is Freedownload for users with this level.
  100.    E = Edit,         User can Edit files in this area (FI while browsing).
  101.    N = NewFilesVisible, UnValidated files are visible.
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.   Parameters for file transfers
  111.   -----------------------------
  112.  
  113.    There are a number of parameters in a users template that have 
  114.    consequences on the number of bytes and files than can be downloaded
  115.    by users.
  116.  
  117.    When a file is not freedownload ratios count for each file downloaded.
  118.    Which means that that must be a certain number of uploads for a
  119.    certain number of downloads. (Note that ratios are optional per template)
  120.  
  121.  
  122.    FileRatio     <= if the ratio between the number of downloaded files and
  123.                     uploaded files is equal or higher then this number then
  124.                     a user has to upload before he can download.
  125.                     disabled when 0 or 'Off'.
  126.  
  127.    ByteRatio     <= if the ratio between the number of downloaded bytes and
  128.                     uploaded bytes is equal or higher then this number then
  129.                     a user has to upload before he can download.
  130.                     disabled when 0 or 'Off'.
  131.  
  132.  
  133.    Als there is an optional limit on the number of bytes a user
  134.    can download in a day.
  135.  
  136.  
  137.    DownloadPerDay <= Number of bytes a user can download each day.
  138.  
  139.  
  140.    There is an option to allow new users to download a number of
  141.    bytes and files before the ratio's kick in.
  142.  
  143.  
  144.    FreeBytes     <= Number of bytes a user can download before ratio's
  145.                     kick in. Note that if zero a new user first has
  146.                     to upload before he can download.
  147.  
  148.    FreeDownloads <= Number of Files a user can download before ratio's
  149.                     kick in. Note that if zero a new user first has
  150.                     to upload before he can download.
  151.  
  152.  
  153.  
  154.   with 'Off' you can turn off a field (same effect as value 0)
  155.  
  156.   You can use 'Off' with:    FileRatio, ByteRatio, MaxBytesPerDay
  157.  
  158.  
  159.  
  160.  
  161.  
  162.   Download constraints
  163.   --------------------
  164.  
  165.    Sometimes users can't mark a file he sees in a list, this can have
  166.    a number of reasons.
  167.  
  168.    No download access:
  169.  
  170.    He needs download access to the section in the template of his level.
  171.    The file section itself needs to have a download flag in the
  172.    fileareas.cfg
  173.  
  174.    File not validated:
  175.  
  176.    If a file is not validated it can not be marked, unless the user
  177.    has the E(dit) flag in the template for this section.
  178.  
  179.    Insufficient time remaining:
  180.  
  181.    If a user tries to mark a file, an estimated transfer time is calculated.
  182.    If that time is longer than the time a user has left online that day,
  183.    the file is not marked.
  184.  
  185.    User will Exceed daily download byte limitation:
  186.  
  187.    A user can only download a number of bytes a day, which is defined
  188.    in a parameter in the template for his level.
  189.  
  190.    User will exceed his file ratio or byte ratio:
  191.  
  192.    When a file is not freedownload, (the file and the template and the
  193.    section has no Freedownload flag) the ratios are valid.
  194.    When a user has downloaded so much bytes or files that he can't
  195.    download anymore he first has to upload before he can download again.
  196.  
  197.  
  198.   File catalogue entry attributes
  199.   -------------------------------
  200.  
  201.    Each file can have a few attributes or flags, at the moment there
  202.    are a two.
  203.  
  204.    Freedownload:
  205.  
  206.    When a file has the freedownload flag it has an other color in
  207.    the file list then other files, and it is not counted in file and
  208.    byte counters for ratios.
  209.    Note that there are separate counters for total downloaded files
  210.    and bytes .. and files and bytes that are not freedownload.
  211.  
  212.    Validated:
  213.  
  214.    When a file is not validated yet it is only shown in the filelist
  215.    when N(ewFilesVisible) flag in the template of the level of the user.
  216.    Files can be automatically validated at upload be giving the file
  217.    section a V(alidate) flag.
  218.  
  219.  
  220.   File area User interface
  221.   ------------------------
  222.  
  223.    When using the default BBStext when listing files there is
  224.    a 2 digit number in front of each file. This number can be
  225.    used to mark a file instead of typing the whole name where
  226.    error are easily made.
  227.    Note the the number start with zero and go up to 99 to start
  228.    at zero again.
  229.    Note that you don't have to type the first digit if it is zero.
  230.  
  231.    When searching for file wildcards such as "*", "#?" or "?" can
  232.    be used. Note that the system will add a '*' at both ends of
  233.    the search string. So you can type a part of a name like "test"
  234.    and the system will transform it into "*test*" to search for
  235.    all file names of file descriptions which contain the word "test".
  236.  
  237.    When a user wants to view an archive the system will determine
  238.    what the type is of the archive. It does this not by looking at
  239.    the extension of the file but by looking at the first bytes of
  240.    the files. At this moment the definition of archive types is
  241.    internal in the BBS program, but this will probably be changed in
  242.    the feature to a configuration file like the archive.cfg or a
  243.    door.
  244.    The BBS program will run the "trion:scripts/viewarchive" script
  245.    to list the contents of the archive to a temporary file in ram:.
  246.  
  247.    Note that when a file is not completely received during an
  248.    upload that the user is asked if the file has te be removed.
  249.    If the file is not removed the file upload can be resumed if
  250.    a protocol is used with a resume option.
  251.  
  252.  
  253.  
  254.   File area configuration.
  255.   ------------------------
  256.  
  257.    File areas are configured in the 'Trion:cfg/FileAreas.cfg'.
  258.  
  259.    Each config line is in a specific format:
  260.  
  261.  
  262.     #area  flags  path  areaName
  263.  
  264.  
  265.     Examples:
  266.  
  267.     #001  [U----]  dh1:DOWNLOADING/Upload/           Upload
  268.     #002  [U----]  dh1:downloading/Sysop/            Voor_Sysop
  269.     #009  [-FV--]  dh1:downloading/Trion/            Trion
  270.     #060  [---M-]  dh1:down.pc/Algemeen/             PC_Algemeen
  271.  
  272.  
  273.     Note:  Don't use area number #0
  274.     Note:  Don't forget a ':' or '/' at the end of a path !!
  275.  
  276.     Look at the provided config for more examples of the format used.
  277.  
  278.  
  279.  
  280.     Each area has a number of flags which decides it's characteristics.
  281.     Which means that those flags can not be overruled by flags in the
  282.     users template.
  283.  
  284.      Flags:
  285.  
  286.      U = Upload       , Area is open for uploads.
  287.      F = Freedownload , All files in this area are freedownload.
  288.      V = Validate     , Files area AutoValidated when Uploaded.
  289.      M = MS-DOS       , All names will be in the 8.3 format in this area.
  290.  
  291.  
  292.     Note that a file is freedownload if either the file has a freedownload
  293.     flag OR the area has a freedowload flag OR the user has a freedownload
  294.     flag for this area in his template.
  295.  
  296.     Note that a user can Upload to an area is the Area has an Upload flag
  297.     AND the user has an Upload flag in his template.
  298.  
  299.     Note that a user with an Edit flag can Validate files, kill files
  300.     and make files freedownload while browsing.
  301.  
  302.  
  303.  
  304.     There is also a configuration file to configure from which sections
  305.     file requests are allowed. The configuration file is called
  306.     frequest.cfg and can default be found in "Trion:cfg/".
  307.  
  308.     The fine exists of 2 parts.
  309.     The first part is a list of the sections from where freqs are
  310.     allowed.
  311.     This section is terminated with a '#' on an empty line.
  312.     The format of this part of the config is:
  313.  
  314.     SECTIONS  <range> [, <range>]
  315.  
  316.     For example:
  317.  
  318.     SECTIONS    3-5 , 9 , 12-14 , 20-35
  319.     SECTIONS    60-73
  320.  
  321.  
  322.     In the second part of the file magic names are configured.
  323.     A magic name is a short fixed symbolic name which is linked
  324.     to a recent path and file.
  325.     The format of this part of the config is:
  326.  
  327.     <MagicName>  <Password>  <Path/File>
  328.  
  329.     if no password needed to freq specify NONE
  330.     password is 6 (or 8) characters of less
  331.  
  332.     For example:
  333.  
  334.     FILES       NONE      downloading:docs/allfiles.lha
  335.     TRION       NONE      down.amiga:bbs/TrionBBS100.LZX
  336.  
  337.  
  338.  
  339.  
  340.     Look for a long explanation of the filenet.cfg and filenodes.cfg
  341.     in the Trion:docs/tick.doc text.
  342.  
  343.  
  344.