PIPEVIEW leaves TMP files

May 20, 2008
10,575
78
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.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,204
72
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,204
72
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.
 
Jan 19, 2011
596
14
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
11,915
133
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,204
72
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
10,575
78
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.