Using opendir() with a filePro file name
Mike Schwartz (PC Support & Services, Appleton, WI)
mschw at athenet.net
Thu Apr 6 08:16:27 PDT 2006
>> where lc is a counter that begins at "3", so that I skip "." and "..".
>
> What makes you think . and .. are necessarily going to be entries 1 and 2?
>
> I've personally never known it not to be the case, but that's an
> assumption
> I would personally not make in the interests of not being surprised at a
> later date.
>
> mark->
That's a good point. This is working on my home Unix system, but if
I ever polish it up and use it on one of my customer sites, I will
test specifically for . and .. and handle them differently.
One surprising thing was the order that the files were listed in my
array. I expected them to be random, but filePro files beginning
with lowercase "a", then "b" through "z" seem to be listed before
upper case "A" and "B" files. Perhaps opendir is reading the files
in inode sequence or some such thing, and what I'm really seeing is
the order in which the files were originally restored off a tape
backup from my old Xenix system.
Maybe I don't have to worry about skipping the processing of . and ..
since I'm using the PRC_MASK option. Opendir is not likely to find
any PRC files in the /appl/filepro subdirectory, although I am
executing this from my "standhere" filePro file, so "." would
probably list the PRC files in my standhere subdir twice; once when
it encounters "standhere" and a second time, when it encounters the
"." subdirectory.
As far as my other non-filepro subdirs in /appl/filepro, I have a
/appl/filepro/stmenu subdir which contains the old softa menus (text
files). I assume the PRC_MASK will simply allow me to process
through the stmenu subdir, not finding any PRC files, and simply go
onto the next subdir, just as if stmenu was a subdirectory for a
filePro file. I should be able to let you know how this works out
this afternoon...
Thanks!
Mike Schwartz
More information about the Filepro-list
mailing list