Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!blars!blarson From: blarson@blars Newsgroups: comp.os.os9 Subject: Re: directory help Message-ID: <149@blars> Date: 18 Dec 90 10:35:39 GMT References: Sender: news@usc Lines: 25 Nntp-Posting-Host: dianne.usc.edu Originator: blarson@dianne.usc.edu In article rh2y+@andrew.cmu.edu (Russell E. Hoffman, II) writes: > There's GOT to be a faster way to get the file descriptors for every file >in a given directory than simply opening each file individually then doing >a _gs_gfd() on the individual files. I have thought about reading all the >directory entries, storing the addresses of each of their FDs in an array >and then opening the physical device (/h0@ or whatever) and grabbing the >FDs all at once, thereny saving a LOT of seek time on the disk, but >the problem is, as Mr. Larson pointed out, you can only run such a program >if you are the superuser, which kind of defeats the whole purpose. Like I pointed out in my other article, you can have your program setuid superuser. Note that dir is one of the microwares programs owned by 0.0 rather than 1.0, probably for this very reason. The 2.3 update covered how to write setuid programs, it isn't in my copy of the technical manual, and is not the same as on unix. Programs owned by 0.0 can call setuid(0), then setuid(anything). -- blarson@usc.edu C news and rn for os9/68k! -- Bob Larson (blars) blarson@usc.edu usc!blarson Hiding differences does not make them go away. Accepting differences makes them unimportant.