- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'musingvisual fortran 6.6 c on windows 2000
I'm writing a script to backup up my fortran sourcefiles in a project. When a sorce file (*,f90,*.for,..)is not in the project's folder i dont know where i could found this information. I open the text files in the project (*.mak and *.dsp)and i found all the sources names, but not the paths.
Thanks in advance
I'm writing a script to backup up my fortran sourcefiles in a project. When a sorce file (*,f90,*.for,..)is not in the project's folder i dont know where i could found this information. I open the text files in the project (*.mak and *.dsp)and i found all the sources names, but not the paths.
Thanks in advance
Luis
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look closer -- sourcefile pathsare within .dsp file, following SOURCE= clause e.g:
SOURCE=..SourceDTPicker.f90
however, the path is obviously relative to the location of .dsp file itself. It's not too dificult to "merge" them though. (I'm just looking at a freeware source code of a Visual Studio add-in which does just that, and I can point you to it if you wish, but it seems easier to roll your own than to look at it as it's written in C++). Also, it states (sigh):
/** Since Visual Studio provides no COM method of returning the names of files in a project, we have to cheat, and read them from the .DSP files on disk. This has at least one primary disadvantage. If a change is made to the project in the Developer Studio, the project MUST be saved before we can process the change here. **/
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mi folder hyerarchy is something like this:
c:fordevgeneral_code (in this folder are things like spline.f90, sort.f90, zeros.f90....
c:fordevproject1 (in this folder are specific source files).
The project includes the source files in "." folder's projectbut also source files from generalcode "....". I cannot readthe name of this path.
Luis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My point is, once you know thatthe relative path is "....something",you can reconstruct the absolute path yourself.
There are APIs like PathCanonicalize and PathCombine (shlwapi.dll) which should let you do that, however, I don't see appropriate INTERFACE blocks for them in CVF INCLUDE folder. Here's some ad-hoc Fortran code which will let you do that:
character(260) sAbsPath
sDspPath = "c:fordevproject1"
sFilePath = "....generalcode"
iFileStart = index(sFilePath, "..")
iCommonEnd = len_trim(sDspPath)
do while (iFileStart .ne. 0)
!Go "up" one backslash in sDspPath for every ".."
!encountered in sFilePath
iCommonEnd = index(sDspPath(1:iCommonEnd-1), "", .TRUE.)
!Remove leading ".." from sFilePath
sFilePath = sFilePath(4:)
iFileStart = index(sFilePath, "..")
sAbsPath = sDspPath(1:iCommonEnd) // sFilePath
Jugoslav

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page