Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!maxim!prc From: prc@erbe.se (Robert Claeson) Newsgroups: comp.unix.questions Subject: Re: Unix file systems (UFS, SVFS, EFS....)? Message-ID: <1822@hulda.erbe.se> Date: 5 Oct 90 12:07:17 GMT References: <25866.27091187@kuhub.cc.ukans.edu> <4136@auspex.auspex.com> Organization: ERBE DATA AB, Jarfalla, Sweden Lines: 38 In a recent article guy@auspex.auspex.com (Guy Harris) writes: :Did Kermit, perchance, expand the wildcards itself, and think that it :could enumerate the names in a directory by reading the directory with :"read()" under the assumption that the directory was filled up with :V7-style 16-byte directory entries? : :That was true a long time ago, but any programmer that *still* thinks :that's ok had better think again, and think hard, and then start using :"opendir()", "readdir()", etc. (for those ancient systems that lack :them, several implementations exist for V7-style directories; #ifdefs :can deal with the problem of the old-style with "struct :direct" and the new-style POSIX-flavored with "struct :dirent"). I'm using one of those systems with multiple file system types in use at the same time, with different directory layouts and file name lengths. Kermit is only one of the packages that I've had to modify to use POSIX directory functions. In fact, most PD software seems to assume that everything that's System V is the ancient Release 2, which only supported the old V7 file system. :However, all the standard POSIX-style calls ("open()", "close()", :"read()", "write()", etc. for I/O to/from files, and "opendir()", :"readdir()", etc. for I from directories, as well as "mkdir()", :"rmdir()", "rename()", "state()", and the like) should work on all those :file systems; use them, don't make your program depend on any aspect of :a particular file system that it doesn't absolutely have to. Is there any way that a program can check how long a file name can be before creating it in a directory without actually trying to create a file first? -- Robert Claeson |Reasonable mailers: rclaeson@erbe.se ERBE DATA AB | Dumb mailers: rclaeson%erbe.se@sunet.se | Perverse mailers: rclaeson%erbe.se@encore.com These opinions reflect my personal views and not those of my employer.