Curtis L. Olson wrote: > Is there a way in nasal to read the contents of a file or list the > contents of a directory? > > Ideally I would like to list all the contents of a directory and build > an array of file names found (and do this in nasal.) > > Is there a way to do this?
I have a seemingly-working I/O library ready that does ANSI C stuff (open, close, read, write, seek, tell, stat, and a readln utility) that I could check in if you want. I've left it out of FlightGear for fear of feature bloat, but it seems to work for the minimal test code I've thrown at it. I think Melchior was interested in seeing this added to CVS too. Unfortunately, this doesn't include directory reads, for which there aren't any portable API standards (Unix has opendir/readdir, whereas windows folks have to make do with the ridiculous FindFirstFile/FindNextFile APIs). I have a "unix" module for this, but it obviously can't be added for portability reasons. Maybe someone could hook the plib directory stuff into NasalSys.cxx? Andy ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel