Submit | Open tickets | Closed tickets

[ Ticket #1197 ] temp files deleted before chooseviewer.py can open them
Date:
11/30/14 12:24
Submitted by:
B_Fristensky
Assigned to:
B_Fristensky
Category:
bioLegato
Priority:
6
Ticket group:
Bug
Resolution:
Resolved
Summary:
temp files deleted before chooseviewer.py can open them
Original submission:
chooseviewer.py is a wrapper for deciding file type by its extension and calling the right application to view the file.
When called by BioLegato, the call to chooseviewer.py is almost always followed by a rm command to delete the temporary file. In many cases, the rm command seems to run before the application can read in the file, so we get a file not found error.

One hack that works is to just put a sleep 5 command between the chooseviewer call and the rm call.

We need to fix chooseviewer.py so that this problem can be solved in a more deterministic way.

Right now, when chooseviewer.py runs commands using Popen,
the p.wait() commands have been commented out. It might
be best to try uncommenting them and see if that fixes the
problem.

Please log in to add comments and receive followups via email.
Followups
Comment Date By
The solution was to make chooseviewer.py sleep for 2 seconds after calling the appropriate wrapper using Popen. This delay allows the wrapper to make a temporary copy of the file that it can then open. p.wait() wasn't the answer, because that means that the calling processes (eg. BioLegato, ACEDB) couldn't do anything until the wrapper and chooseviewer.py had terminated. This lets the wrapper run in the background, even if you terminat the calling program.
03/06/15 18:58 B_Fristensky
No results for "Dependent on ticket"
No results for "Dependent on Task"
No other tickets are dependent on this ticket
Ticket change history
Field Old value Date By
status_id Open 03/06/15 18:58 B_Fristensky
resolution_id Unset 03/06/15 18:58 B_Fristensky
close_date 12/31/69 19:00 03/06/15 18:58 B_Fristensky
status_id Pending 11/30/14 12:24 B_Fristensky
priority 5 11/30/14 12:24 B_Fristensky
assigned_to unset 11/30/14 12:24 B_Fristensky

© 1998-2025 Scilico, LLC. All rights reserved.