PIPEVIEW leaves TMP files

May 20, 2008
12,165
133
Syracuse, NY, USA
Hmmm! I can think of not-too-costly ways to get around that. When V is started, start a clean-up thread, passing it a pointer to a struct containing V's PID and the file name. The thread would wait for the V process, delete the file, and terminate.
 
May 20, 2008
12,165
133
Syracuse, NY, USA
You're assuming that TCC is the parent pipe process. That is not necessarily the case.
I may not fully understand, but some instance of TCC executes PIPEVIEW. Doesn't that instance of TCC know the filename and V's PID?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,689
106
Albuquerque, NM
prospero.unm.edu
It seems to me that deleting a temp file on exit should be V's responsibility, not TCC's. V.EXE ought to have an option meaning "this is a temp file; delete it when you exit." Idea for the next version?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,689
106
Albuquerque, NM
prospero.unm.edu
And on the subject of TCC/V integration: It would be nice if TCC had a way to pass a "cosmetic" filename to V, to be displayed in the V title bar instead of the actual filename. That way, given a command like view clip: or view http://www.jpsoft.com/, V would show the original source of the text -- not the filename of a temp file, which the user probably doesn't care about.
 
In the registered version of V, there is this dialog box under Tools -> Delete Temporary Files;

2321


Joe
 
Jan 19, 2011
614
15
Norman, OK
deleting a temp file on exit should be V's responsibility, not TCC's
It should be the responsibility of the program creating the temp file to delete it.

That'd be like the city coming out to fix the water meter at your house, digging a huge hole so they can get at the surrounding pipe and then leaving saying... "It was just a temp hole, you fill it."
 

rconn

Administrator
Staff member
May 14, 2008
12,556
167
Hmmm! I can think of not-too-costly ways to get around that. When V is started, start a clean-up thread, passing it a pointer to a struct containing V's PID and the file name. The thread would wait for the V process, delete the file, and terminate.

That would work in a few cases. But not when you've got multiple pipes on the command line, or if TCC terminated before V.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,689
106
Albuquerque, NM
prospero.unm.edu
It should be the responsibility of the program creating the temp file to delete it.

That'd be like the city coming out to fix the water meter at your house, digging a huge hole so they can get at the surrounding pipe and then leaving saying... "It was just a temp hole, you fill it."

I disagree. V isn't a passive bystander here; it's an active participant in using the file. (And deleting a file once you're through with it is not a particularly onerous chore.)

If there is some way to know when V has opened a handle to the file, then AnrDaemon's approach would work too.
 
May 20, 2008
12,165
133
Syracuse, NY, USA
If there is some way to know when V has opened a handle to the file, then AnrDaemon's approach would work too.
I think that depends on whether the file may be opened again. The docs say that further attempts to open it will fail if DeleteFile has marked it for deletion.
 

Similar threads