* DISK/DIRECTORIES COPYING EXTENSION for the SINCLAIR QL * .hpr'2.2.1997 * -= VERSION CD16 =- Copyright: (C) 1996 by H-Peter Recktenwald, Berlin-Friedenau T.: ++49 30 8520413 Inet: phpr@berlin.snafu.de Archive "CDISK16B", with "CDISK_byt", "CBACK_obj" and related texts. The program(s) may only be distributed cost free, unchanged and complete, this text, the german description(s) and any other related stuff inclusive; it was used successfully but, nothing is promised nor will be, thus no warranty applies. Installation: CDISK, backup utility: LRESPR "CDISK_byt" or, adr=RESPR(3000):LBYTES"CDISK_byt":CALL adr. CBACK, an example application: EX "CBACK_OBJ" if the QLib-runtimes present or, LRUN "CBACK_prg", the SBasic source program. Changes: Vers. CD14 (26.11.1996): Some bugs fixed. Names also accepted as names of f.p.-type variables. Update modes added. Move (source deleted after copying) added. Postfix-separator conversion for QDOS<=>MSDOS filenames. Example program CBACK for automatic regular updates Vers. CD15 (14.12.96): Format$-dummy "MPTY" to just clear the source-directories. Automatic determining of the source-files host systems specific directory filetype coding, to working with directories of _any_ QDOS-computer (THOR, or CST, etc.). Names of incomplete files fetched via network correctly marked. The "CBACK" example job: Selectable protocol destination, Quit and Window move options. 'WHEN ERRor' supporting version of the QLib runtimes required. TK2 recommended, and required to executing in pre-JS systems. Vers. CD16 (2/23.2.97): SER-Net filenames supported. -key can terminate the files transfer. Minor bugs fixed. Additional signal at the beginning of the file transfers. ERNUM keyword added (for CBACK to working with JM systems). Extension "."/"_" detection completed. CBACK made a bit more comfortable. Use: CDISK can be used to recursively copying/updating all files and/or any or selected directories, subdirectories in- or exlusively, from any medium to any other medium suitable to QDOS file-i/o, any combination of remote media via the TK2 network file server inclusive. File dates remain unchanged. Partially copied or faulty files will be marked "#"&name and remain on disk - if renaming supported by the particular file systems (Minerva, TK2), otherwise they may be recognized by length and date. Post-fixed M.S.DOS-/ATARI-DOS file names will be converted to "_"&postfix and, vice versa to "."&postfix, when copying between different systems disks, provided the default system handlers support those formats (e.g. SMSQ). Call: CDISK [#errorchan[,#displaychan],] Source$,Destination$ [,Format$] Parameters: Numbers in the 16-bit range (as SBasic ..%-variables). Names of any QL-ASCII char in a string: "win1_qlux#79" or, as the names of f.p.-variables: win1_qlux_no_79. Delimiters "!" 1st delimiter "!" to suppress any error break of the procedure; 2nd delimiter "!" to restrict copying to non-recursive. Source$ may be any devicename or directory to copy from; Destination$ may be any devicename or directory to copy to. Format$ optionally leads to the destination device(s) being formatted before the/each partial transfer begins. Format$:="MPTY" clears the source sub-/directory. Destination$ formally required but left untouched. Format$:="MOVE" special coding to deleting the files/directories sources just copied, not including the primary source directory. Format$:="UPDT" special coding to copying those files that are of a more recent date or, that are not yet stored on the destinaton medium. Format$:="NAME" update mode, only if source and destination media name are equal (case dependent). Format$:=Mediumname$ Update if the destination medium name exactly corresponds to Mediumname$ - which does NOT include the devicename, nor permits an underscore "_" in 5th place. #errorchan optionally displays any error messages while copying, and the interrogation to proceed if the destination medium is full. By default set to #1, redirected to #0 if #1 not accessible. #displaychan optionally displays any filenames after copying succeded. By default set to in-active. CTR/SPACE (or ALT/CTR/SPACE in Minerva SBasic jobs) can be used to immediately (after a running file transfer ends) terminate the procedure, error free returning to SBasic. Examples: The compiled Basic program CBACK can be used to automatically backing up in regular intervals of up to 32767 minutes (22+ days); the other modes of operation are also accessible. It may be invoked parameterless EX CBACK where anything required will be asked for, or with parameter EX CBACK;"Source Destination Medium TimingInterval" where "TimingInterval" is the number of minutes to wait, which operates silently in the background with only a cursor sized window to accepting the control keys: S save immediately R restart (parameterless only, else quit) quit CDISK#1,#2,flp1_,flp2_,flp2_name Formatting "flp2_name", then copying all files and (sub-) directories from "flp1_" to "flp2_"; directories first. Error messages will be sent to #1, the names of the files just copied will be written to #2. CDISK"flp1_t1_"!"flp2_" selectively copies all files/directories the names of which begin with "t1_" from "flp1_" to "flp2_", stripping off the source prefix "t1_". If an error occurs the procedure will terminate with no message nor break, due to "!" being the 1st delimiter, and leave the error code to be read by ERNUM. CDISK"flp1_","mdv2_t1_" copies all files/directories "flp1_xxxx" to "mdv2_t1_xxxx" and does NOT produce a new directory "mdv2_t1_", such that it can be used to copy files from a directory to a disk formatted by one of the pre-"level 2" file systems. CDISK n2_flp1_,n2_win4_zip_ copies remotely via network with no problems at all, and considerably faster than with the SBasic WCOPY command. CDISK"win1_","win4_win1_" WIN_FORMAT 1,1:FORMAT"win1_20":WIN_FORMAT 1,0 CDISK"win4_win1_","win1_","MOVE" backing up, re-formatting and restoring the old contents of "win1_", cleaning up the intermediate storage medium. No messages will be sent by the procedure. CDISK#-1,#-1,flp1_,flp2_,"UPDT" copying new files and overwriting only those of older dates, any messages suppressed by negative channel numbers. CDISK#-1,#2,flp1_,flp2_,backdisk No error messages, protocol sent to #2, copying only if the destination medium was formatted with the name "backdisk", or any other disk name as passed with this parameter; err.bn (-12) otherwise. CDISK win1_ut_,flp2_,"NAME" copying as above, taking the backup-medium name from source, i.e. copying will only be carried out if source and destination bear the same medium name. Which in this very special example means that the backup disk must have been formatted FORMAT flp2_WIN1 CDISK flp2_,flp3_,MPTY just removes all files and sub-/directories from flp2. CDISK"flp1_","flp2_","flp1_name" returns err.ro ("read only") to prevent the source medium accidentally being formatted. » .hpr'97 » eof »