Path: utzoo!censor!geac!aimed!ncrcan!attcan!uunet!wuarchive!usc!dianne.usc.edu!blarson From: blarson@dianne.usc.edu (bob larson) Newsgroups: comp.os.os9 Subject: Re: pd software/unix utils Keywords: os9 unix utilities Message-ID: <26808@usc.edu> Date: 26 Aug 90 06:10:42 GMT References: <3919@disk.UUCP> <3337@rwthinf.UUCP> <3970@disk.UUCP> Sender: news@usc.edu Organization: USC software systems, home of TOADS Lines: 50 Nntp-Posting-Host: dianne.usc.edu In article <3970@disk.UUCP> stevenw@disk.UUCP (Steven Weller) writes: >I agree that a real mv is a nice thing to have, Almost essential if you have usenet on your machine. >It would be nice of Microware to supply one with OS-9. Yup, but I'm not waiting for them. They did the important part of making i$del understand them. > Always claim and release resources in the same order; >that way circular dependencies can not be formed. Actually, you want to claim ALL needed resorces before making ANY change. Release them all if any cannot be obtained. This way it doen't matter which of the two directories is locked first. The entire destination directory must be locked to ensure another file of the same name isn't being created at the same time. >>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. Parinoia in the order of doing things is the best you can do about a process dieing in the middle of ln or mv -- always incrament the link count before writing the new name out (If interupted, link count will be one to high so disk sectors will be claimed when they are not needed after the original file is deleted.) and remove the old name before writing the new name on mv -- interuption will mean a missing file and more claimed but unused disk sectors. Both of these (hopefully rare) conditions make a good disk checking fixing program more important. (Have you ever wondered why unix checks disks after a crash and os9 doesn't?) >I will avoid ln until the rest of OS-9 knows about the link field. I intend to write a disk checking program that understands links eventually. News is higher priority right now. Actually, this discussion has led to my considering rechecking my mv/ln to make sure it is parinoid. I will fix the move directory to subdirectory problem, even though I already restrict directory moves to the superuser. -- Bob Larson (blars) blarson@usc.edu usc!blarson Hiding differences does not make them go away. Accepting differences makes them unimportant.