openDir is confusing

brian <briand-/[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
I'm tyring to write a file tree "visitor" function and I find the  
operation of openDir/readDir to be somewhat hard to work with.

An example is always good to start with:


d = openDir("somelongpathname")
readDir(d) => "foo" -- a file
readDir(d) => "bar" -- a directory

d2 = opendir("bar")

error - no such file or directory

Of course, this is correct, because I did not pass in the full  
pathname.  Therein lies the problem, I think.  It seems as I'm  
traversing the directory, I would have to maintain the path which  
readDir is operating from.  So why doesn't readDir simply return the  
FULL path in the first place instead of just the pathname ?

Am I missing something, or should I be using some different  
functionality ?

Thanks

Brian


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.