Execute_command_line

Magnus Hagdorn Magnus.Hagdorn@marsupium.org
Tue Oct 8 08:23:00 GMT 2013


On 07/10/13 19:53, Steve Kargl wrote:
> On Mon, Oct 07, 2013 at 06:13:14PM +0000, Szabó László wrote:
>> Thanks Steve!
>>
>> I tried SYSTEM subroutine earlier, but this method doesn't wait
>> for the executed program has been finished. I would like to copy
>> some big size files in a fortran program, and after copy I would
>> like to open these files. Since SYSTEM doesn't wait for the end
>> of copying when I try to open files, I get "No such file" errors....
>
> call system("cp file1 file2 && sync")
>
> or
>
> call system("cp file1 file && sleep 2")
>
> or
>
> call system("cp file1 file2")
> call sleep(2)
>

In the past when I had to copy files I wrote a C function to do the 
copying using mmap'ed source and destination and then memcpy. You then 
just need to use the iso C bindings to call your function from fortran.

magnus



More information about the Fortran mailing list