- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1) I'm well aware of the intrinsic inquire function which applies to a statement like:
inquire (file = "FileName.inp", exist=result)
But suppose I want to inquire about the existence of a Directory. Is there a counterpart statement for this? In some checking I've done, I haven't been able to find such.
2) Suppose we can find a way to determine the existence of some Directory. If for a statement like the above result = .true., then suppose we want to purge (delete) it from an earlier run (so it can be created anew). Is there a simple command to Remove this Directory?
In preliminary checking, I'm not sure I have seen a reliable command for this, especially one that isn't very dependent on the library one is using. FWIW, in my case, I'm using DFlib (not iFort).
In DOS, I could always do this very easily.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have to say (echoing FortranFan) that in my commercial applications which are windows based I would use windows sdk routines and standard Fortran only. Pumping out external commands such as I exampled I tend to use in 'for my own benefit only' quick bits of code as you can do a lot with very little code if you don't have all the potential pitfalls to secure against. Sticking a command that can kill entire directory trees without warning is a bit of a worrying one if you have not been ultra careful in its use.
Anyway, TommyCee, I'm glad you found a result suitable for your needs and learned a couple of things which it the main objective and benefit of participating in forums such as this. I learn useful things here all the time....
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Duly noted. I appreciate your perspective.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have to say (echoing FortranFan) that in my commercial applications which are windows based I would use windows sdk routines and standard Fortran only. Pumping out external commands such as I exampled I tend to use in 'for my own benefit only' quick bits of code as you can do a lot with very little code if you don't have all the potential pitfalls to secure against. Sticking a command that can kill entire directory trees without warning is a bit of a worrying one if you have not been ultra careful in its use.
Anyway, TommyCee, I'm glad you found a result suitable for your needs and learned a couple of things which it the main objective and benefit of participating in forums such as this. I learn useful things here all the time....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just noticed Fortran 2008 introduces an intrinsic procedure named “execute_command_line” that may work similarly as SYSTEM function, if and when it is implemented in Intel Fortran.
In ISO/IEC JTC1/SC22/WG5 N1891 document by John Reid titled, “The New Features of Fortran 2008”, this procedure is described as follows:
[plain]
9.9 Execute command line
call execute_command_line(command[,wait,exitstat,cmdstat,cmdmsg])
starts execution of another program if the processor supports command line execution.
command has intent in and is a scalar default character holding
the command line to be executed.
wait has intent in and is a scalar default logical. If present with
the value false, and the processor supports asynchronous execution of
the command, the command is executed asynchronously; otherwise it is
executed synchronously.
exitstat has intent inout and is a scalar default integer. If the
command is executed synchronously, it is assigned the value of the
processor-dependent exit status. Otherwise, the value is unchanged.
cmdstat has intent out and is a scalar default integer. It is assigned
the value -1 if the processor does not support command line execution,
a processor-dependent positive value if an error condition occurs, or
the value -2 if no error condition occurs but wait is present with the
value false and the processor does not support asynchronous execution.
Otherwise it is assigned the value 0.
cmdmsg has intent inout and is a scalar default character. If an error
condition occurs, it is assigned a processor-dependent explanatory
message. Otherwise, it is unchanged.
When the command is executed synchronously, the subroutine returns
after the command line has completed execution. Otherwise, it returns
without waiting. If an error condition occurs and cmdstat is not
present, error termination of execution is initiated.
[/plain]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, that intrinsic would be similar to SYSTEM, though with more flexibility.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"Answer unclear. Ask again later."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it later yet dad? :-)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »
This is existing feature request ID DPD200169310. I'm sure we'll get to it eventually.
Will this be some time soon now?