directory copies as zero-length file from job_working_directory?
Hi all, So I have a tool that I am writing a wrapper script for that produces a directory of images as one of its outputs. This directory gets created just fine in the job_working_directory, but then when the job finishes and the contents of the job_working_directory are copied, the copy of the images directory is a zero-length *file*. I seem to recall having this problem before and finding a solution to it, but now I can't seem to find it. Any ideas? - Nik. -- Nikhil Joshi Bioinformatics Analyst/Programmer UC Davis Bioinformatics Core http://bioinformatics.ucdavis.edu/ najoshi -at- ucdavis -dot- edu 530.752.2698 (w)
So I found the solution we used before... is there a reason this code hasn't been changed? Is there a better way to do what I want to do? Here is the solution we used: Yes, you have to modify lib/galaxy/objectstore/__init__.py: In class DiskObjectStore find the function 'update_from_file' (line ~340) and replace: try: shutil.copy(file_name, self.get_filename(obj, **kwargs)) except IOError, ex: log.critical('Error copying %s to %s: %s' % (file_name, self._get_filename(obj, **kwargs), ex)) by: try: if os.path.isdir(file_name): dir_name = self._get_filename(obj, **kwargs) os.remove(dir_name) shutil.copytree(file_name, dir_name) else: shutil.copy(file_name, self.get_filename(obj, **kwargs)) except IOError, ex: log.critical('Error copying %s to %s: %s' % (file_name, self._get_filename(obj, **kwargs), ex)) - Nik. On Thu, Mar 28, 2013 at 7:06 PM, Nikhil Joshi <najoshi@ucdavis.edu> wrote:
Hi all,
So I have a tool that I am writing a wrapper script for that produces a directory of images as one of its outputs. This directory gets created just fine in the job_working_directory, but then when the job finishes and the contents of the job_working_directory are copied, the copy of the images directory is a zero-length *file*. I seem to recall having this problem before and finding a solution to it, but now I can't seem to find it. Any ideas?
- Nik.
-- Nikhil Joshi Bioinformatics Analyst/Programmer UC Davis Bioinformatics Core http://bioinformatics.ucdavis.edu/ najoshi -at- ucdavis -dot- edu 530.752.2698 (w)
-- Nikhil Joshi Bioinformatics Analyst/Programmer UC Davis Bioinformatics Core http://bioinformatics.ucdavis.edu/ najoshi -at- ucdavis -dot- edu 530.752.2698 (w)
Hi Nikhil, I've encountered this issue as well when using the API. Some scripts were using a 5 second sleep default to allow for copying the file to the output directory, but I found that I needed up to 15 seconds (occasionally that's not even enough). Cheers, Rob Rob Leclerc, PhD P: (US) +1-(917)-873-3037 P: (Shanghai) +86-1-(861)-612-5469 Personal Email: rob.leclerc@aya.yale.edu On Mar 28, 2013, at 10:06 PM, Nikhil Joshi <najoshi@ucdavis.edu> wrote:
Hi all,
So I have a tool that I am writing a wrapper script for that produces a directory of images as one of its outputs. This directory gets created just fine in the job_working_directory, but then when the job finishes and the contents of the job_working_directory are copied, the copy of the images directory is a zero-length *file*. I seem to recall having this problem before and finding a solution to it, but now I can't seem to find it. Any ideas?
- Nik.
-- Nikhil Joshi Bioinformatics Analyst/Programmer UC Davis Bioinformatics Core http://bioinformatics.ucdavis.edu/ najoshi -at- ucdavis -dot- edu 530.752.2698 (w) ___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/
participants (2)
-
Nikhil Joshi
-
Rob Leclerc