lsst-ts / ts_phosim

High-Level Module to Perturb the PhoSim
GNU General Public License v3.0
0 stars 1 forks source link

add flag to allow clobbering of existing directories to prevent excep… #28

Closed connolly closed 4 years ago

connolly commented 4 years ago

Allow clobbering of output directory so ISR does not throw an exception when overwriting files. Default is for no clobbering

teweitsai commented 4 years ago

Please ask to merge into develop branch instead of master branch in PR.

connolly commented 4 years ago

moved to develop branch

bxin commented 4 years ago

When I tried this in a docker container, I got the following error

OSError: [Errno 16] Device or resource busy: '/home/lsst/output'

I think this is because the path '/home/lsst/output' is mapped to a path on the local machine.

connolly commented 4 years ago

Are you running with the clobber flag set to true when this error occurs and in docker you cant delete the local machine directory?

bxin commented 4 years ago

Are you running with the clobber flag set to true when this error occurs and in docker you cant delete the local machine directory?

That is correct.

connolly commented 4 years ago

When you are in the docker container can you remove the directory manually (ie. rm -rf /home/lsst/output)?

bxin commented 4 years ago

No. I get the same error.

teweitsai commented 4 years ago

If you mount a volume (/mnt/dir) from the host machine to a docker container (/docker/dir), you can do rm -rf /docker/dir/* in the container, but not rm -rf /docker/dir. The implementation of --clobber may not consider the use of docker and do the shutil.rmtree(outputDir) directly.