[Ecls-list] Bug fix for Slime C-c C-k in Windows

Dustin Long dlong at stevens.edu
Tue May 22 04:23:50 UTC 2007


Juan Jose Garcia-Ripoll wrote:
> Today I have set up a similar mechanism for Windows now. The idea is
> that _all__ loaded files are duplicated and automatically destructed
> either on garbage collection or at program exit. Unfortunately Windows
> does not have symlink() so I had to use the command line processor to
> call COPY. Could you have a look at it and if you find something
> better, propose it here?
That seems to work pretty well! However, I don't think using the 
command-line will work; for one thing it probably won't handle paths 
with spaces. If it's okay adding Windows specific code to 
copy_object_file, which seems reasonable, then CopyFile would be a 
better idea. The first attached patch uses this in place of 
cl_concatenate + si_system.
> As for mkstemp, I do not understand the problem. ECL just uses
> mktemp() when mkstemp() is not available (I presume this is the case
> in Windows), but mktemp() allows for SIX digits/characters in the
> temporary file name, so there is probably something wrong in the C
> library.
Oops, I guess I should have better explained. Luckily I found an msdn 
article: [ http://support.microsoft.com/kb/50351 ]. Since Window's 
mktemp only generates 27 unique names, it's unsuitable for many 
purposes, such as Slime development. Using GetTempFileName inside 
si_mkstemp would work though. The second attached patch wraps 
GetTempFileName to more or less replicate the behavior of mkstemp.

Also, I ran into a small glitch with time.d. The timeval struct was 
already defined for my environment but "HAVE_GETTIMEOFDAY" wasn't. I 
just turned the guard on line 45 into a "#if 0", which I'm sure isn't 
the proper solution. I don't know how the build picks up that #define, 
though.

Dustin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01_2007-05-21-windows-loading.patch
Type: text/x-patch
Size: 578 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20070522/4b1845f8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02_2007-05-21-mkstemp-fix.patch
Type: text/x-patch
Size: 1165 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20070522/4b1845f8/attachment-0001.bin>


More information about the ecl-devel mailing list