home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / lan / lan.doc < prev    next >
Text File  |  1988-06-29  |  24KB  |  674 lines

  1.  
  2.  
  3.  
  4.  
  5.                                    FLOPPY-LAN
  6.                        (A floppy based local-area-network)
  7.  
  8.                                  by L. P. Levine
  9.                          3942 N. Oakland Avenue, Apt 241
  10.                                Shorewood, WI 53211
  11.  
  12.                      This  is  a Beta test version  of  a  file 
  13.                  control system.  It is available for use at no 
  14.                  cost.   Please  let  the  author  know   about 
  15.                  failures  and desired features.  The  programs 
  16.                  install.pas, lanmkdir.pas and lancomp.pas  and 
  17.                  the  batch  file lan.bat are copyright  L.  P. 
  18.                  Levine   1988.   The  program   touch.exe   is 
  19.                  copyright Peter Stephen Heitman 1986.
  20.  
  21.              This  system allows a user to work on two PC  computers  (so 
  22.         called IBM compatible), one that I will call the Home machine and 
  23.         the other the Work machine and keep a reasonable number of  files 
  24.         on  both machines current.  The program will permit the  user  to 
  25.         carry  a  floppy disk containing copies of  whatever  files  have 
  26.         changed  from  Home to Work and back with no  special  attention, 
  27.         other than to run a process twice on each machine, once when  the 
  28.         user arrives at the machine, and again, just before leaving.   Of 
  29.         course  the two computers must share a common floppy drive  type.  
  30.         The  amount  of file space supported can be  considerably  larger 
  31.         than  the  capacity of a single floppy when the program  is  used 
  32.         with the TRIM feature.
  33.  
  34.              In practice, the user inserts a floppy disk and types  "LAN" 
  35.         when  arriving at work and again just before leaving the  office.  
  36.         When the user gets home, it is only necessary to insert the  same 
  37.         disk  and type "LAN" before beginning and again after  completion 
  38.         of  home based work.  Any files that have changed are written  to 
  39.         and from the floppy disk as the user moves that disk from machine 
  40.         to machine.  
  41.  
  42.              In  writing this document, I wrote part of the  documenation 
  43.         at  home  and part at work.  I did software development  at  both 
  44.         places.   Files transferred without attention and at no time  did 
  45.         the fingers leave the hand.
  46.  
  47.              With  the  exception of the PICNIX  program  touch.exe,  all 
  48.         programs  are  presented in source form.  The  programs  install, 
  49.         lanmkdir  and  lancomp deal only with text files and do  no  user 
  50.         file manipulation.  All file manipulation is done with normal DOS 
  51.         calls (copy, del, mkdir, command, and dir) and with touch.  These 
  52.         calls appear in machine written batch files.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.         floppy-LAN                                                 Page 1
  63.  
  64.  
  65.  
  66.                               EXECUTION PROCEDURES
  67.  
  68.              The  batch file "lan.bat" is custom written by  the  INSTALL 
  69.         program.   Lan.bat  consists  of  5  main  parts.   First  is  an 
  70.         execution  of the program "lanmkdir" which reads a list of  files 
  71.         to  be dually supported and writes a batch file  "x1.bat".   That 
  72.         batch file is executed next, and outputs to a data file "x1.dat".  
  73.         Third is executed a program "lancomp" which reads that data  file 
  74.         and  prepares  a second batch file "x2.bat" whose purpose  is  to 
  75.         replace  the older version of each of the supported files by  the 
  76.         younger.   x2.bat  is then executed and  files  are  transferred.  
  77.         Finally,  in  the delivered version of the program, the  3  files 
  78.         named  "x?.?at"  are  deleted.  Pictorially it  might  appear  as 
  79.         follows:
  80.  
  81.              Process:               Data Files:      What Happens:
  82.              ------------           -----------      -----------------
  83.              lanmkdir.com   <---      lan.fil        A list  of  files is
  84.                             --->      x1.bat         changed into a  list
  85.                                                      of DIR commands.
  86.              x1.bat         --->      x1.dat         The DIR commands are
  87.                                                      executed   into   an 
  88.                                                      output file.
  89.              lancomp.com    <---      x1.dat         Differences in dates
  90.                             --->      x2.bat         are noted. COPY com-
  91.                                                      mands are created.
  92.              x2.bat                                  Files   are    moved
  93.                                                      between  the  floppy 
  94.                                                      and hard drives.
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.         floppy-LAN                                                 Page 2
  124.  
  125.  
  126.  
  127.                               SYSTEM INITIALIZATION
  128.  
  129.         FLOPPY DISK.  A floppy disk must be formatted that is  compatible 
  130.         with  both systems.  A directory called \lan must be put on  that 
  131.         disk  and  one  file,  a copy of  lan.fil,  (the  list  of  files 
  132.         supported)  or  its alias must be put into that  directory.   LAN 
  133.         will add any other files and directories needed.
  134.  
  135.         HARD  DISKS.  On each of the two host machines a  root  directory 
  136.         must  be created called \lan.  In that directory the  four  files 
  137.         lan.bat,  lan.fil, lanmkdir.com and lancomp.com must  be  placed.  
  138.         (Touch.exe  might be put in this directory also.)   Lanmkdir  and 
  139.         lancomp are Turbo Pascal 3.01 programs whose sources are included 
  140.         with  this package.  Lan.bat is a file that must be  tailored  to 
  141.         each of the installations.  Lan.fil is a file in which is put the 
  142.         names  of  the  files  to  be  commonly  supported.   Finally,  a 
  143.         subdirectory of \lan on the hard disk called \lan\baq should (but 
  144.         not must) be created.
  145.  
  146.         LAN.FIL.   This  file  is the main user interface  with  the  LAN 
  147.         system.   In  it  the user must place all files that  are  to  be 
  148.         maintained  on the two machines.  The first file  supported,  and 
  149.         therefore the first entry, must be the file \lan\lan.fil  itself.  
  150.         Other file names may be added at any time.  An example of lan.fil 
  151.         and  instructions  for  its control are shown  in  the  Technical 
  152.         Details section below.
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.         floppy-LAN                                                 Page 3
  185.  
  186.  
  187.  
  188.                                 TECHNICAL DETAILS
  189.  
  190.         The  program uses four files: lan.bat, lanmkdir.com,  lancomp.com 
  191.         and  lan.fil.  They should be installed in the directory \lan  on 
  192.         the hard drive of both the Home and Work computers.  In  addition 
  193.         a  subdirectory \lan\baq should be prepared.  No special  pathing 
  194.         is  needed.  During execution of the batch file, three files  are 
  195.         created,  \lan\x1.bat,  \lan\x1.dat, and \lan\x2.bat.   They  are 
  196.         normally deleted at the end of the execution, but their  deletion 
  197.         can be inhibited (so that you can look at them) by the removal of 
  198.         the last line of lan.bat.
  199.  
  200.         LAN.BAT
  201.  
  202.              Lan.bat  is  a  batch file.  It is created  by  running  the 
  203.         INSTALL  program  on each of the two computers used.   A  typical 
  204.         file is shown below:
  205.  
  206.                                  @echo off
  207.                                  lanmkdir BC
  208.                                  command /c \lan\x1
  209.                                  lancomp
  210.                                  command /c \lan\x2
  211.                                  del x?.?at
  212.  
  213.         LANMKDIR
  214.  
  215.         Name:     lanmkdir - Create batch Directory commands
  216.         Usage:    lanmkdir [FH [FILE]]
  217.         Version:  1.00 for PC-DOS and MS-DOS
  218.  
  219.                   (C)  Copyright  L.  P.  Levine  1988   --   All  Rights           
  220.         Reserved. 
  221.  
  222.         The options for lanmkdir are:
  223.  
  224.              FH   The drive letters used for the Floppy and Hard Disks.
  225.                   Default values are A and C.
  226.  
  227.              FILE The file used for input. Default value is lan.fil.
  228.  
  229.              Lanmkdir is a Turbo Pascal program which may be called  with 
  230.         options.   In the example above, the options are B and  C,  where 
  231.         the  first  letter  (B) is the floppy drive to be  used  and  the 
  232.         second letter (C) is the hard drive.  It reads data from  lan.fil 
  233.         and  writes the file x1.bat.  The filename of the input file  may 
  234.         be added as a second option.  Thus:
  235.  
  236.                               lanmkdir AD SUSIE.FIL
  237.  
  238.         will use drives A and D and take data from file SUSIE.FIL.  If no 
  239.         options are used the default drives are A and C, and the  default 
  240.         file is lan.fil.
  241.  
  242.  
  243.  
  244.  
  245.         floppy-LAN                                                 Page 4
  246.  
  247.  
  248.  
  249.         LAN.FIL
  250.  
  251.              The ASCII file lan.fil is the list of files to be  supported 
  252.         on  the two computers.  An example of a typical lan.fil is  shown 
  253.         below:
  254.  
  255.                                  \lan\lan.fil
  256.                                  \an\NOTES.
  257.                                  \llclass\students.dbf 
  258.                                  \llclass\students.ndx
  259.  
  260.         The  first file supported is lan.fil itself, to ensure  that  the 
  261.         two computers are working from the same list.  If a file with  no 
  262.         extension is desired be sure to include the '.' at the end of its 
  263.         name,  as  is shown in the example for the file  \an\notes.   The 
  264.         filenames may be entered case independent and with the usual  mix 
  265.         of  wildcards.   Wildcard  use is not encouraged  as  it  becomes 
  266.         increasingly  difficult to keep track of the files  created  when 
  267.         they are used.  (For example, a scrap file may be created in  the 
  268.         wildcard  group.  It is dutifully saved and  transferred.   Later 
  269.         the user may delete the file at home.  It may well be returned at 
  270.         the  next execution of LAN and will show up again and again  like 
  271.         the  bad  penny.)  In the present version no root  files  may  be 
  272.         supported.
  273.  
  274.         X1.BAT
  275.  
  276.              The  output  of lanmkdir is the file x1.bat which,  for  the 
  277.         example above will be:
  278.  
  279.                   @echo off                                      
  280.                   echo --System Messages, if any-----
  281.                   echo -------------------------------- >x1.dat 
  282.                   dir B:\lan\lan.fil >>x1.dat
  283.                   echo -------------------------------- >>x1.dat 
  284.                   dir C:\lan\lan.fil >>x1.dat
  285.                   echo -------------------------------- >>x1.dat 
  286.                   dir B:\an\notes. >>x1.dat
  287.                   echo -------------------------------- >>x1.dat 
  288.                   dir C:\an\notes. >>x1.dat
  289.                   echo -------------------------------- >>x1.dat 
  290.                   dir B:\llclass\students.dbf  >>x1.dat
  291.                   echo -------------------------------- >>x1.dat 
  292.                   dir C:\llclass\students.dbf  >>x1.dat
  293.                   echo -------------------------------- >>x1.dat 
  294.                   dir B:\llclass\students.ndx >>x1.dat
  295.                   echo -------------------------------- >>x1.dat 
  296.                   dir C:\llclass\students.ndx >>x1.dat
  297.                   echo -------------------------------- >>x1.dat      
  298.  
  299.  
  300.              When  x1.bat is executed, output is generated  into  x1.dat.  
  301.         An example of x1.dat follows:
  302.  
  303.  
  304.  
  305.  
  306.         floppy-LAN                                                 Page 5
  307.  
  308.  
  309.  
  310.         X1.DAT
  311.  
  312.                   --------------------------------  
  313.                    Volume in drive B has no label
  314.                    Directory of  B:\LAN
  315.                   LAN      FIL      384   6-09-88   1:10p
  316.                           1 File(s)     35840 bytes free
  317.                   --------------------------------  
  318.                    Volume in drive C is DRIVE_C    
  319.                    Directory of  C:\LAN
  320.                   LAN      FIL      384   6-09-88   1:10p
  321.                           1 File(s)   5181440 bytes free
  322.                   --------------------------------  
  323.                    Volume in drive B has no label
  324.                    Directory of  B:\AN
  325.                   NOTES            3141   6-08-88  11:49a
  326.                           1 File(s)     35840 bytes free
  327.                   --------------------------------  
  328.                    Volume in drive C is DRIVE_C    
  329.                    Directory of  C:\AN
  330.                   NOTES            3141   6-07-88  11:01p
  331.                           1 File(s)   5179392 bytes free
  332.                   --------------------------------  
  333.                    Volume in drive B has no label
  334.                    Directory of  B:\LLCLASS
  335.                   STUDENTS DBF    75894   5-30-88  12:06p
  336.                           1 File(s)     35840 bytes free
  337.                   --------------------------------  
  338.                    Volume in drive C is DRIVE_C    
  339.                    Directory of  C:\LLCLASS
  340.                   STUDENTS DBF    75894   5-31-88   7:12p
  341.                           1 File(s)   5177344 bytes free
  342.                   --------------------------------  
  343.                    Volume in drive B has no label
  344.                    Directory of  B:\LLCLASS
  345.                   STUDENTS NDX    63488   5-30-88  11:47a
  346.                           1 File(s)     35840 bytes free
  347.                   --------------------------------     (extra lines have
  348.                    Volume   in  drive  C  is  DRIVE_C         have   been 
  349.         removed.)
  350.                    Directory of  C:\LLCLASS
  351.                   STUDENTS NDX    63488   5-30-88  11:47a
  352.                           1 File(s)   5177344 bytes free
  353.                   --------------------------------  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.         floppy-LAN                                                 Page 6
  368.  
  369.  
  370.  
  371.         LANCOMP
  372.  
  373.         Name:     lancomp - makes copy commands
  374.         Usage:    lancomp [TRIM]
  375.         Version:  1.00 for PC-DOS and MS-DOS
  376.  
  377.                   (C)  Copyright  L.  P.  Levine  1988   --   All  Rights           
  378.         Reserved. 
  379.  
  380.         The only option for lancomp is:
  381.  
  382.                        TRIM  Causes  files  on the  floppy  drive  to  be 
  383.                   reduced  in size           after transfer to  the  hard 
  384.                   drive.   Use  only  after            system  has   been 
  385.                   debugged.  Option is case dependent.
  386.  
  387.         Lancomp  is  a program that reads the file x1.dat  and  writes  a 
  388.         command  file x2.bat.  From the example above it should be  clear 
  389.         that the hard disk copy of the file students.dbf is younger  than 
  390.         the floppy copy.  In x2.bat (below) line 4 creates a new  version 
  391.         for the floppy drive, with echo on so that the user sees what  is 
  392.         happening.   Since  the  file B:\an\notes  is  younger  than  its 
  393.         version on the hard disk, lines 6-8 move a copy to the hard disk, 
  394.         after  saving  the  original  version of the  file  in  a  backup 
  395.         location  (line  6).  Finally, if the TRIM option of  lancomp  is 
  396.         used,  lines  10 and 11 replace the floppy copy with  a  file  of 
  397.         length zero bytes.  That file occupies NO disk space on drive  B, 
  398.         permitting more files to be supported by LAN than will fit on the 
  399.         floppy  disk.  The file is created and its date is set  with  the 
  400.         unix  like touch command.  The only legal option for  lancomp  is 
  401.         the option TRIM (case matters).  The continuous switching of  the 
  402.         echo commands permits control of system messages.
  403.  
  404.         X2.BAT          
  405.  
  406.                  @echo off
  407.                  echo --System Messages, if any-----
  408.                  echo on
  409.         line 4   copy C:\LLCLASS\STUDENTS.DBF  B:\LLCLASS\STUDENTS.DBF
  410.                  @echo off
  411.         line 6   copy C:\AN\NOTES.  C:\LAN\BAQ  >nul:
  412.                  echo on
  413.         line 8   copy B:\AN\NOTES.  C:\AN\NOTES.  >nul:
  414.                  @echo off
  415.         line 10  del B:\AN\NOTES. >nul:
  416.         line 11  touch 0608114988 B:\AN\NOTES.
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.         floppy-LAN                                                 Page 7
  429.  
  430.  
  431.  
  432.         TOUCH.EXE
  433.  
  434.         This file was taken from the shareware PICNIX set and is included 
  435.         (with permission) with this program. Its documentation,  repeated 
  436.         below, can be displayed to the screen with the command "touch /h"
  437.  
  438.         Name:     touch - update last-write times of files
  439.         Usage:    touch [ -c ] [ mmddhhmm[yy] ] file1 ...
  440.         Version:  1.0 for PC-DOS and MS-DOS
  441.  
  442.                   (C)  Copyright  Peter  Stephen Heitman  1986   --   All 
  443.         Rights  Reserved   Distributed with the PiCnix  Package  (tm)  by 
  444.         Peter Stephan Heitman
  445.  
  446.         The options for touch are:
  447.  
  448.           -c: prevent touch from creating files that
  449.               did not previously exist
  450.  
  451.           [mmddhhmm[yy]]: set the last-write times of the arguments
  452.               to the given date and time.
  453.  
  454.           NOTE:   If the date and time are not given on the command line,
  455.                   the last-write times of the arguments are set to the
  456.                   current system time
  457.  
  458.           /?: display this description of the program
  459.  
  460.         NOTE:   If  the environment variable TOUCH exists, its  value  is        
  461.         used to establish default options.
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.         floppy-LAN                                                 Page 8
  490.  
  491.  
  492.  
  493.                                      OPTIONS
  494.  
  495.         The call to the program lanmkdir is:
  496.  
  497.                   lanmkdir [FH [FILE]]
  498.  
  499.         The options are:
  500.  
  501.              FH   The drive letters used for the Floppy and Hard Disks.
  502.                   Default values are A and C.
  503.  
  504.              FILE The file used for input. Default value is lan.fil.
  505.  
  506.         Typical calls are:   
  507.  
  508.                  lanmkdir              {Drives A and C, file lan.fil}
  509.  
  510.                  lanmkdir AD           {Drives A and D, file lan.fil}
  511.  
  512.                  lanmkdir BC TEST.FIL  {Drives B and C, file TEST.FIL}
  513.  
  514.         The call to the program lancomp is:
  515.  
  516.                   lancomp [TRIM]
  517.  
  518.         The options are:
  519.  
  520.              TRIM Causes files on the floppy drive to be reduced in  size           
  521.         after   transfer   to   the   hard   drive.    Use   only   after           
  522.         system has been debugged.  Is case dependent.
  523.  
  524.         Typical calls are:   
  525.  
  526.                  lancomp               {Does not reduce size of 
  527.                                         floppy files after transfer}
  528.  
  529.                  lancomp TRIM          {Reduces size of floppy files
  530.                                         after transfer}
  531.  
  532.  
  533.         The directory \lan\baq. 
  534.  
  535.              Before  each  transfer of data from the floppy disk  to  the 
  536.         hard  disk,  the  file  about to be replaced  is  copied  to  the 
  537.         directory \lan\baq, if that directory exists.  Thus, the previous 
  538.         edition of all files on the hard disk is preserved in this backup 
  539.         directory.   If  the directory does not exist, the  feature  will 
  540.         fail  and no backup will be made.  We recommend that the  feature 
  541.         be used.
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.         floppy-LAN                                                 Page 9
  551.  
  552.  
  553.  
  554.                                  ERROR MESSAGES
  555.  
  556.         Message:  File [filename] does not exist.
  557.  
  558.                   If the file lan.fil, or its equivalent does not exist, 
  559.                   the  program  lanmkdir will fail  with  this  message.  
  560.                   Check  to see if you have correctly handled the  alias 
  561.                   name, if you are using one.
  562.  
  563.         Message:  File not found
  564.  
  565.                   Invalid Directory
  566.  
  567.                   If  a file was recently added to the lan.fil list,  it 
  568.                   might  well not be on one of the volumes  (either  the 
  569.                   floppy or hard drive).  If that is the case, the batch 
  570.                   file X1.BAT will generate this message.  It is not  an 
  571.                   error, merely an unavoidable diagnostic.
  572.  
  573.         Message: There is a File On Hard Drive, not on Floppy Drive:
  574.                   C:\dir\file.ext
  575.                   Should I move it to floppy?(y,n)
  576.  
  577.                   There is a File On Floppy Drive, not on Hard Drive:
  578.                   A:\dir\file.ext
  579.                   Should I move it to hard drive?(y,n)
  580.  
  581.                   A new file has been created on one machine's hard disk 
  582.                   and  put  into  lan.fil.  This  message  requests  the 
  583.                   user's permission to write it to the floppy, or later, 
  584.                   to  the  hard  disk on the other  computer.   (In  the 
  585.                   example,  the  name of the file is  \dir\file.ext,  in 
  586.                   reality, the true name of the file is used.)  A "y" or 
  587.                   an "n" must be entered.
  588.  
  589.         Message: There is a problem with file \dir\file.ext
  590.                   (the floppy file is newer, but is of length zero.)
  591.                   (there may be a clock error, no action will be taken.)
  592.                   Strike a key to continue.
  593.                      
  594.                   This is a message that should never arise.  When  used 
  595.                   with  the TRIM option, the files on the  floppy  drive 
  596.                   are replaced with zero length files after being  moved 
  597.                   to a hard drive.  Thus there can be no way for a  hard 
  598.                   disk  file  to  have an earlier date  than  this  zero 
  599.                   length floppy file.  If, however, the time or date was 
  600.                   wrongly set on one computer, or if a computer  battery 
  601.                   clock  stops,  or  if the touch command  was  used  to 
  602.                   backdate  a  file, time may  actually  run  backwards.  
  603.                   This message reports on that event.  No data  transfer 
  604.                   occurs.
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.         floppy-LAN                                                 Page 10
  612.  
  613.  
  614.  
  615.         Message: Unable to create directory
  616.  
  617.                   In batch file X2.BAT, an attempt to move a NEW file to 
  618.                   either  the hard or floppy disk is always preceded  by 
  619.                   an  attempt  to create the associated  directory.   If 
  620.                   that  directory  already  exists,  this  message  will 
  621.                   result.   It  is not an error, merely  an  unavoidable 
  622.                   diagnostic.
  623.  
  624.         Message: Insufficient disk space
  625.  
  626.                   It means what it says; bad news. Using the TRIM option 
  627.                   will enormously reduce the probability of having  this 
  628.                   message  appear when it applies to a  floppy  transfer 
  629.                   disk.   If  you are using the TRIM option  and  change 
  630.                   files   controlling  a  large  amount   of   supported 
  631.                   filespace  in  one  session,  then  this  message  can 
  632.                   appear.  Corrective action might be:  split the system 
  633.                   into several small parts, make fewer changes at  once, 
  634.                   deal with smaller files.
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.         floppy-LAN                                                 Page 11
  673.  
  674.