å ä, 2003-12-30 23:56, Morbus Iff åéï > Besides the utf8 problems, there were two things that were bugging me > about PAR, things that were stopping me from shipping it to end-users: > > b) The name of the temp directory was based off the process ID of > the running application. I believe that this decision was made > to stop the application from clobbering old versions that were > not properly deleted from the tmpdir (is this right?).
Correct. And also to prevent files from different users from stepping
over each other.
> What would be nearly perfect would be if:
> * I could say "hey! store the temp extracted files into
> "./data/internal", so, if C:\AmphetaDesk\AmphetaDesk.exe,
> it'd extract to C:\AmphetaDesk\data\internal\. This would
> allow me to feel good about telling people that AmphetaDesk
> munges with only it's directory, and no where else.
Currently, setting up a AmphetaDesk.bat that says:
mkdir C:\AmphetaDesk\data
set PAR_TEMP=C:\AmphetaDesk\data\internal
C:\AmphetaDesk\AmphetaDesk.exe
seems to work for me.
However, for 0.78, I'm rethinking the temp dir semantics. It seems to
me that PAR should:
- If PAR_TEMP is specified, use it as the working directory (the
one to store temporary files), and never clean up that directory
after exiting, to avoid race conditions.
- If PAR_TEMP is not set, look at PAR_CLEARTEMP to determine
whether to clean up after existing:
- If yes, use $TEMP\par-$PID\ as the working directory,
cleaning it both before and after execution.
- If no, use $TEMP\par-$USER-$EXEID\ as working directory,
reusing any existing files inside. (The default case)
The $EXEID should be something that differs from one executable to
another; maybe its basename + size, maybe something else. This is to
prevent exe files with different Perl58.dll from clobbering each other.
So, by default, the same AmphetaDesk.exe should always get executed in
the same directory. Does it sound sane for you all?
I have just checked in code to do the above, except the part that
generates "$USER-$EXEID"; suggestions are most welcome. :)
Thanks,
/Autrijus/
signature.asc
Description: =?UTF-8?Q?=E9=80=99=E6=98=AF=E6=95=B8=E4=BD=8D=E5=8A=A0=E7=B0=BD?= =?UTF-8?Q?=E7=9A=84=E9=83=B5?= =?UTF-8?Q?=E4=BB=B6?=
