If you're working on a UNIX platform (and possibly other platforms
as well though I don't know for sure), you can make a "system"
call to do such things as create directories and remove
files.
For example:
call system("mkdir dir1")
call system("rm -f test0001")
See whether the platform/compiler you're working on supports
system calls.
Catherine
Xiaogang Wang wrote:
>
> Hi,
>
> I have simple questions about file operations.
>
> How can I make a directory in fortran?
> My codes generate thousands of files and I want to put them in a
> directory so that it looks tidy. I have to make a directory before
> running the code 'dir1' and then
> open(21,file='dir1/test0001')
>
> How can I delete a file in fortran?
> One clumsy way I can think of is to open the file, rewind, and close.
> The file is still there but has lenght 0.
>
> regards
>
> Xiaogang
>
> ------------------------------------------------
> Dr Xiaogang Wang
> Departement de chimie
> Universite de Montreal
> C.P. 6128, succursale Centre-ville
> Montreal (Quebec) H3C 3J7
>
> Tel. (514) 3436111 ext 3947 (office)
> FAX (514) 3437586 (office)
> e-mail: [log in to unmask]
> homepage: http://www.esi.umontreal.ca/~wangx
> ------------------------------------------------
|