Mail Archives: djgpp-workers/2003/01/26/13:57:25
Hello.
Eli Zaretskii wrote:
[snip]
> It should also be possible to do this from a normal DOS prompt:
>
> sh -c 'make install'
Yes, I hadn't thought of that. Thanks. If I do another release, it'll have the
updated instructions in readme.dos.
> Alternatively, we could invent some trick to be put into ginstall's
> sources that would work around the problem in a way Unix systems do.
> Perhaps the new fd_props feature could help (via the delete-on-close
> feature)?
>
> Btw, do I understand correctly that the problem only happens on
> Windows? IIRC, DOS doesn't care if you overwrite a running program's
> executable file on disk.
On further investigation it seems like I'm confusing file removal and file
overwriting.
You can't unlink a running file on Windows. You may be able to under DOS, but
that could cause filesystem corruption unless you have SHARE running,
according to Ralph Brown's Interrupt List.
You can overwrite a running program. See the program overme.c at the end of
this mail. It works fine on Windows. I don't know about DOS.
I said:
"Since "make install" will overwrite the install program, we can't use
ginstall. It can't overwrite itself with another executable, when it's
running."
This is actually untrue. It does work. Again, I don't know about DOS.
Sorry for the confusion.
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
---Start overme.c---
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int
main (int argc, char *argv[])
{
FILE *fp = NULL;
fp = fopen(argv[0], "w");
if (!fp)
{
puts("Bleurgh");
return(EXIT_FAILURE);
}
fprintf(fp, "foo\n");
fclose(fp), fp = NULL;
return(EXIT_SUCCESS);
}
---End overme.c---
- Raw text -