On Fri, 2007-04-13 at 19:00 -0700, Jonathan Lang wrote: > Please. I've always found the "opendir ... readdir ... closedir" set > to be clunky. > > Also: why distinguish between "open" and "opendir"? If the string is > the name of a file, 'open' means "open the file"; if it is the name of > a directory, 'open' means "open the directory". If it's the name of a > pipe, it opens the pipe. And so on.
As long as you still have some way to reach the low-level opens -- though it's an odd thing to do (except perhaps in a disk integrity checker), there's no fundamental reason why you shouldn't be able to actually look at the bytes that happen to represent a directory structure on disk. Also, for security or correctness reasons you may want to make sure that you don't clobber things you don't mean to -- so non-dwimmy open variants are a good idea to keep around. This could be as simple as 'open(:!dwim)' I guess, or whatever the negated boolean adverb syntax is these days .... -'f