Path: utzoo!attcan!uunet!mcsun!unido!rwthinf!strange!krischan From: krischan@strange.informatik.rwth-aachen.de (Christian Engel) Newsgroups: comp.os.os9 Subject: Re: pd software/unix utils Keywords: os9 unix utilities Message-ID: <3337@rwthinf.UUCP> Date: 20 Aug 90 07:58:30 GMT References: <1990Aug7.185337.4532@cs.utk.edu> <2394@mcrware.UUCP> <3300@rwthinf.UUCP> <3919@disk.UUCP> Sender: news@rwthinf.UUCP Reply-To: krischan@strange.UUCP (Christian Engel) Organization: Informatik RWTH Aachen Lines: 53 In article <3919@disk.UUCP> stevenw@disk.UUCP (Steven Weller) writes: > >It is not necessary to use system calls if all you want to do is >copy-then-delete. Simply write a program mv that collects all its >command-line parameters and forks copy with them. If that is >successful (ONLY if it is successful !) fork del to delete the >file(s) with appropriate arguments. That's no move!!!! That's childish! >The Unix mv does some clever things: That's what I'm talking about! > it moves the references to the >data, not the data itself. This is where the problems occur >on OS-9. Several processes can try to do this at once, resulting >in a damaged file structure. > >The solution (I have not tried this) is to use record locking. ^^^^^^^^^^^^^^^^^^^^^ but you should! ^^^^^^^^^^^^^^^^^^^^^^^^ I don't think so >If you consult the technical manual, you find that the record >locking facilities of RBF are quite comprehensive. The mv utility >must lock out all the files (i.e. directories and files) >conerned with the operation, do the critical work, then close >all the files. There are two problems: You don't talk about ln (link). It must modify (increment) the link count in the file descriptor of the file to be linked. Since there is no system call to do this (I've read the technical manual), you have to do the work on the raw device. DO YOU WANT TO SUGGEST RECORD LOCKING ON THE COMPLETE RAW DEVICE?!?!?! How about another process sharing time with ln? There is an extreme danger of a dead lock! Second, there is another problem with both the mv and the ln utilities: if you do it by a simple program (with or without record locking) the process could be killed between the two modifications of the file system it has to do. This would result in an inconsistent file system. In the case of system calls, they only can be interrupted by a reset or a power off. But there isn't any process or system call that is secure of these rigid methods. Krischan -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- krischan@informatik.rwth-aachen.de *** mcvax!unido!rwthinf!strange!krischan Christian Engel, Lehrstuhl fuer Informatik I, RWTH Aachen Ahornstr. 55, D-5100 Aachen, W. Germany