START_PC.PRG V1.04


The decision to write this program was made after Pure C destroyed a file. Sure this happens seldom, but even under normal circumstances having a lot of backups is always usefull.
 

Description of the program


Instead of starting PC directly you start this program. It will then test whitch source files have changed since the last Backup, then these files are saved. Then PC is started. There are many ways to start PC, one is with a CFG file as parameter. This has the advantage, that PC is exactly in the same configuration as the last time you worked on that project, even if you used PC for something else in the meantime. Assuming that a Backup system is only useful for such projects, I wrote this program around this method.
 

Installation


This program must be in the same directory as PC.PRG. To make life easier register this file in your shell for *.CFG files. Then double clicking on a cfg starts this program, this loads the corresponding PRJ file (by analyzing the cfg), finds out whitch files should be saved, tests if this files have been changed since the last time and if so saves them, then PC is started. To know where to save the files a destination has to be defined, either in the environment ( the variable is called PCBCK_DIR), if this is not defined the PRJ is searched for 'PCBCK_DIR='. For example:

; PCBCK_DIR=i:\backup\pc
The ';' is necessary to make PC ignore this line.

special remark for ASH-Emailer users

since for the Emailer you are supposed to register Iconnect for iconnect.cfg there is a problem. So you have to register PCBCK for

*.cfg&!iconfset.cfg.

Update from 1.03 or older


For the update itself there is nothing special to mention, but since only from 1.04 on *.h, *.rsc,... files will be saved it is advisable to make a full Backup once after installing 1.04 or newer. Else a *.h (...) would only be saved after it changes the next time.
 

how to use it


There are two Backup methods, packed and unpacked.

  • packed: there has to be either an environment variable PACKER or a corresponding entry in the PRJ file like
  • ; PACKER=g:\packer\lha\lharcger.ttp
    then for every Backup a file BCK_9999.lzh will be written, where 9999 is a consecutive number. Of course if you use a different packer, the extension might be different.
  • unpacked: a new directory BCK_9999 will be created and the files will be saved therein. Since no sub directories will be created all files must have different names.
  • In both cases a logfile is also written. In every line of the PRJ whitch contains the name of a file whitch you want to be included in the backups a marker (#bck) has to be included. For files without path the path of the PRJ is used. If you press a 'special' key ( Kbshift(-1)!=0 ) while PCBCK is started, a full Backup is made instead of an incremental one.

    new in version 1.04


    Besides the PRJ file the coresponding PDB file is analyzed too. In short *.c,*.C,*.s,*.S files are selected according to the PRJ as described above. Other files listed in the PDB are saved as well. The reason that I don't only use the PDB is that it is not always up to date. It is always a good idea (not only for PCBCK) to sometimes delete the PDB and make a complete build. But finding all *.h files for example just by first reading the PRJ and then the *.C files would have been very difficult. For every *.h a coresponding *.rsc is searched and if existing included in the files to be saved.
     

    Example


    To make all the above easier to understand I include one of my PRJ files:

    ;>>>>>>> Viewer.PRJ <<<<<<<<
    ; PACKER=g:\packer\lha\lharcger.ttp
    Viewer.prg ; Name of executable program is topmost window
    .C [ -Y ]
    .L [ -L -Y ]
    .S [ -Y ]
    = ; List of modules follows...

    PCSTART.O ; startup Code
    viewer.c ; c-file #bck
    d:\soft_ent.w\biblioth.ek\gr_file ;#bck
    d:\soft_ent.w\biblioth.ek\gr_fkt ;#bck
    d:\soft_ent.w\biblioth.ek\gr_fkt_s.s ;#bck
    d:\soft_ent.w\biblioth.ek\easyfsel ;#bck
    d:\soft_ent.w\biblioth.ek\easyfs_s.s ;#bck
    d:\soft_ent.w\biblioth.ek\fenster ;#bck
    d:\soft_ent.w\biblioth.ek\fensters.s ;#bck
    d:\soft_ent.w\biblioth.ek\gdps ;#bck
    d:\soft_ent.w\biblioth.ek\my_err ;#bck
    d:\soft_ent.w\biblioth.ek\my_mem ;#bck
    d:\soft_ent.w\biblioth.ek\bezier ;#bck
    d:\soft_ent.w\biblioth.ek\bezier_s.s ;#bck
    d:\soft_ent.w\biblioth.ek\submenue\submenu ;#bck
    ;PCFLTLIB.LIB ; floating point library
    PC881LIB.LIB ; floating point library
    PCSTDLIB.LIB ; standard library
    PCLNALIB.LIB ; LINEA library
    PCEXTLIB.LIB ; extended library
    PCTOSLIB.LIB ; TOS library
    PCGEMLIB.LIB ; AES and VDI library

    ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

    beside that in my magx.inf are the following lines to declare environment variables:

    #_ENV PCBCK_DIR=E:\BACKUP\PC\
    #_ENV PACKER=G:\PACKER\LHA\LHARCGER.TTP
    These two definitions could of course be included alternatively in the PRJ
     

    Limitations


    This is one of the first versions, and it definitely is not written for dummies. I think that I can assume from a C programmer that he (she) does not confuse PACKER and Packer. The pathes where source files are searched are limited to the path of the PRJ, so if it is somewhere else include the full path in the prj.
     

    Copyright


    This program is fairware, that means you can copy it freely, even add it to PD packets or even add it to commercial programs. But if you use it regularly you might find it worth to spend some money for it. If you do so I'll notify you by E-mail if there is a update.

    Pure C is a registered trademark of Application Systems Heidelberg
     

    Author

     
    Dimitri Junker
    E-Mail
    for normal mails (<16k):Dimitri_Junker@AC2.Maus.De
    for long mails (>16k):Dimitri.Junker@EPost.De