ice1980
09-22-2009, 02:04 PM
I'm trying to navigate directories within my fortran program to do certain DOS commands, like, makedir, cd. Actually, I've gotten makedirqq, fullpathqq, and changedirqq to work; however, is there a way to move up a directory, similar to cd..? I've been doing character to character matching to try to capture directories of interest, there has to be something more efficient.
Here's the bigger picture:
I read a line to a variable - var_a = "c:\temp\p1\file1.txt"
I would like to make a dir called "c:\temp\p2\".
My program needs to run from "c:\"
Other conditions:
There may be files in different subdirs:
var_b = "c:\temp\a1\file3.txt"
var_c = "c:\temp\coconuts\file3uy.txt
I essentially want to consoliate var_a, var_b, var_c into the "p2" directory, so the end result will be:
c:\temp\p2\file1.txt
c:\temp\p2\file3.txt
c:\temp\p2\file3uy.txt
Clear as mud? So, how do I move up a directory, or is there a more efficient way to consolidate my files? Help is much appreciated!
Here's the bigger picture:
I read a line to a variable - var_a = "c:\temp\p1\file1.txt"
I would like to make a dir called "c:\temp\p2\".
My program needs to run from "c:\"
Other conditions:
There may be files in different subdirs:
var_b = "c:\temp\a1\file3.txt"
var_c = "c:\temp\coconuts\file3uy.txt
I essentially want to consoliate var_a, var_b, var_c into the "p2" directory, so the end result will be:
c:\temp\p2\file1.txt
c:\temp\p2\file3.txt
c:\temp\p2\file3uy.txt
Clear as mud? So, how do I move up a directory, or is there a more efficient way to consolidate my files? Help is much appreciated!