NickFort
Technical User
- Jun 10, 2010
- 113
(I could have sworn I posted this a week or so ago, and then it disappeared. I hope it's not a duplicate; if it is, my apologies.)
Is there a portable way of returning the directory structure and contained files to Fortran for processing?
An example of what I want to do:
- Get the directory/file structure
- Parse each file sequentially
- Determine something I need in each file
That way, I could, for example, check that my Makefile has all of the dependencies, or automatically create documentation in TeX format, etc.
One (non-portable) solution is to use system-dependent programs for this. Windows has "tree", so running "tree /F > structure.txt" and then reading and interpreting "structure.txt" in Fortran would do the trick. I'm sure Linux has more powerful ways of doing this.
However, is there a system-independent way of doing it?
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
Is there a portable way of returning the directory structure and contained files to Fortran for processing?
An example of what I want to do:
- Get the directory/file structure
- Parse each file sequentially
- Determine something I need in each file
That way, I could, for example, check that my Makefile has all of the dependencies, or automatically create documentation in TeX format, etc.
One (non-portable) solution is to use system-dependent programs for this. Windows has "tree", so running "tree /F > structure.txt" and then reading and interpreting "structure.txt" in Fortran would do the trick. I'm sure Linux has more powerful ways of doing this.
However, is there a system-independent way of doing it?
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.