home *** CD-ROM | disk | FTP | other *** search
- MoveFiles, version 0.95, 27 Jun 1990
- ====================================
-
-
- *************************** Copyright Notice **************************
- * *
- * The object code and documentation for the 'MoveFiles' utility are *
- * the exclusive copyright of Michael Ben-Gershon and are freely *
- * distributable, provided this notice is left intact and all of the *
- * files listed below are included, UNALTERED. *
- * *
- *************************************************************************
-
-
- Included :-
- ReadMe (Text)
- MoveFiles (Module)
-
-
-
- Introduction:
- =============
-
- This utility is designed to 'fix' a couple of major problems with the RISC
- OS desktop, until such time as Acorn decide to fix them properly!
- 1) It prevents directories from being copied recursively into
- themselves from the desktop.
-
- 2) It speeds up the copying of large files and directories when
- they are on the same file medium, by using '*Rename' instead
- of '*Copy'
-
- When present, it should be largely transparent to the user. Its memory
- requirements are very modest (about 2k, including workspace).
-
-
-
- Technical details:
- ==================
-
- The utility sets up an alias for the 'copy' command, which causes it to
- generate a command:
-
- Desktop_NewCopyFiles
-
- which takes the same parameters as the original 'copy' command. This
- command is recognised by the MoveFiles module. When the module is 'killed',
- the alias is unset, thus restoring 'normal' operation of the 'copy' command.
-
-
- Internal Algorithm:
- ===================
-
- On entry, we first check the number of parameters. If there are two, it
- cannot be a desktop originated copy command, as the desktop ALWAYS gives
- copy options as its third parameter.
-
- If there are three parameters, and the copy options given match the ones the
- desktop uses for 'file moves' (ignoring the C and V options, which are
- variable in the desktop) and both filename strings match up to the first '.'
- (meaning that the two files are on the same file medium), and the
- destination file does not exist, the copy command is replaced with a rename
- command. Before the rename command is issued, the file's attributes are
- read. If the file was locked, it is unlocked before the rename, then locked
- again afterwards. When locking again after the rename, both the source and
- destination files are locked in case the rename was aborted. Attempting to
- set the attributes of nonexistent files does NOT give an error, so this is a
- safe strategy to use.
-
- If the command was not a desktop originated copy command (or was deemed to
- be a desktop 'copy' as opposed to a desktop 'move' by the previous part of
- this algorithm) and the 'R' copy-option is currently set (either by the
- actual copy command, or the system variable 'Copy$Options'), the filenames
- are checked to see if the second is a subdirectory of the first. This check
- is NOT foolproof! If, for example, the command
-
- *Copy $.scrap scrap.scrap R
-
- is issued at the command line, the check will fail, and infinite recursion
- will result, as before. However, the test is really designed for the
- desktop, where full filenames are always given. It simply compares the
- second filename with the first - if it is fully contained by the first, and
- the first character where it is longer than the first filename is a '.', it
- is deemed to be a subdirectory of it.
-
-
-
- Correction to PRM:
- ==================
-
- Please note that OS_ReadVarVal does NOT preserve R0 on exit, even though the
- PRM (volume 2, page 750) states that it does!
-
-
-
- Versions:
- =========
-
- 0.90 First released version
-
- 0.92 Fixed a bug when more than 3 parameters were given (ie multiple
- copy options separated by spaces followed the second filename when
- used from the command line). As with the OS version of copy, the
- internal 'Desktop_NewCopyFiles' command now takes from 2 to 255
- parameters. Bug discovered thanks to Keith Sloan.
-
- 0.94 Fixed a bug which tended to ignore all file moves where the
- destination file existed already, even with the 'F' copy option
- set. Such file moves are now done using a 'copy' operation,
- not a 'rename'. Rewrote large sections of the code.
-
- 0.95 Added a syntax error message to ensure that it behaves in a totally
- transparent manner - as if it were the 'genuine' *copy command.
-
-
-
- Conditions of use:
- ==================
-
- This software is supplied "as is"; no warranty, express or implied, of the
- merchantability of this software or its fitness for any particular purpose
- is given. In no circumstances shall the providers of this software be
- liable for any damage, loss of profits, or any indirect or consequential
- loss arising out of the use of this software or inability to use this
- software.
-
- You are free to give this application to anyone you please via any medium,
- provided it is delivered with ALL the supplied files, UNALTERED. You may
- NOT sell this software, or use it otherwise for personal gain. If you wish
- to post it on your Bulletin Board or include it in your Shareware library
- then that, too, is fine.
-
-
- You have permission to use any part or the whole application in a project
- you intend to place in the public domain, as long as I am fully credited. If
- you wish to use these routines in a program that is for sale (for however
- much and for whatever reasons) or released as copyright material then my
- express permission in writing must be obtained. I maintain copyright on all
- the material supplied and reserve the right to amend these conditions in
- case where I deem misuse.
-
- A large number of hours of work have gone into the production and
- maintenance of this application and although I have supplied the application
- free, donations will be gratefully received (and if over 7 pounds I will send
- you a disc with updates of this and all other pd stuff I have written.
- Please include a letter telling me which apps of mine you use and their
- version numbers).
-
- Please report any bugs you find to me, so that other users may benefit from
- improved versions. I cannot guarantee to fix any bugs, but I will do my
- best.
-
- My address is:
-
- Michael Ben-Gershon
- 8 Linnell Drive
- LONDON NW11 7LT
-
- No telephone calls please.
-
- However, I can be contacted as:
- Prestel (and SID): 014554781
- Janet: umace03@doc.ic.ac.uk (until September 1990)
- Archive BBS: 0603 745932 (mailbox 396)
- The World of Cryton: 0749 670030 / 679794 (mailbox 100)
-
-
- Thanks are due to Brothers In Arm for giving me the idea of how to implement
- the basics of this module.
-
-
- © Michael Ben-Gershon 1990 - USE and Enjoy!
-