Molcas Forum

Support and discussions for Molcas and OpenMolcas users and developers

You are not logged in.

Announcement

Welcome to the Molcas forum.

Please note: The forum's URL has changed. The new URL is: https://molcasforum.univie.ac.at. Please update your bookmarks!

You can choose an avatar and change the default style by going to "Profile" → "Personality" or "Display".

#1 2016-12-12 12:40:26

kommerck
Member
Registered: 2016-12-12
Posts: 5

EMIL command to copy a directory?

Is it possible to copy a whole directory with an EMIL command? The copy commands >> COPY or >> SAVE can't copy a directory, >> SHELL cp -r ... doesn't work as MOLCAS stops and forces me to use COPY or SAVE instead, and neither >> SHELL sh -c "cp -r ..." does. Any hints on that?

Thanks in advance
Leon

Offline

#2 2016-12-12 14:13:49

kommerck
Member
Registered: 2016-12-12
Posts: 5

Re: EMIL command to copy a directory?

My current workaround is >> SHELL rsync -a, but this can't be the solution (it requires rsync to be installed on the system)

Offline

#3 2016-12-12 20:03:38

Ignacio
Administrator
From: Uppsala
Registered: 2015-11-03
Posts: 1,085

Re: EMIL command to copy a directory?

You could create a script that contains the "cp -r ..." command, and run it with "> SHELL $CurrDir/myscript.sh", or copy it to $WorkDir and run it with "> SHELL ./myscript.sh". Or maybe create an alias for "cp", so you can just run "> SHELL my_aliased_cp -r ...", or put a script in your path that accepts arguments: "> SHELL my_cp_r.sh ...". (All of this is untested, though.)

But maybe the question is whether you actually need to copy a directory, maybe there's a better way to achieve what you are trying to do?

Offline

#4 2016-12-13 12:37:38

kommerck
Member
Registered: 2016-12-12
Posts: 5

Re: EMIL command to copy a directory?

Thank you for your reply Ignacio. I'm working with the QCMaquis DMRG-MOLCAS interface, and QCMaquis checkpoints, which I need to copy, are directories, so there's no way around it. Is there any specific reason why MOLCAS forbids >> SHELL cp ... (one could issue a warning instead of an error and stop, e.g.)

Offline

#5 2016-12-13 16:53:03

valera
Administrator
Registered: 2015-11-03
Posts: 129

Re: EMIL command to copy a directory?

kommerck,
One of the elements of EMIL philosophy is: avoid side effects. However, as Ignacio pointed out, you always can make a shell script and execute it from EMIL.
To be more specific, copy of a file is an expensive operation. If Molcas run in parallel is really really expensive operation.
If you need a copy a directory with unknown content - for me it is a clear indication that the code design at that point is poor.

Offline

Board footer

Powered by FluxBB 1.5.11

Last refresh: Today 17:11:06