New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows improvements #57
Conversation
There is no setenv, nor unsetenv, but we can emulate both of them using putenv.
It signaled a non-existent condition type
First, look at TMP instead of TMPDIR on Windows. Second, it's not possible to unlink a file if someone has it open, unless you use CreateFileA/W and set FILE_SHARE_DELETE. Therefore, note that OPEN-TEMPORARY-FILE may return a pathname as a second value. If it does, the user is reponsible to delete that file. Third, modify WITH-TEMPORARY-FILE to unlink the file.
Involves some slight modifications of tests and completely disabling some tests.
Addittionally, mark all functions that depend on that as supported
It's present, just not always useful
On non-Windows platforms there is no need to change the current directory; we can just merge with *D-P-D* and absolutize. Additionally, specify that the target is merged with the link's directory. Otherwise, it's possible to inherit the name or type from link if it is unspecified in target, which is probably not what anyone wants.
Now that most things are implemented on windows as well, there's no need to keep separate files for the high-level interface.
@daewok merged, thanks! I've given you the commit bit, BTW. Feel free to push directly in the future, or to continue to send pull requests if you'd like a code review. Improvement ideas 1 and 2 seem very good, I agree. BTW, do you know about https://github.com/Lovesan/doors? There might be some intersection here. |
That's awesome, thanks! I did not know about doors (but love the name). If I keep digging into Windows stuff I'll definitely take a look at it. |
This set of commits implements most of the missing high-level functionality on Windows. The only thing remaining unsupported is
user-info
. Because of that, I also removed the split between osicat.lisp and osicat-basic.lisp (sorry for the diff noise that creates!).Much of the missing functionality required calling out to win32 APIs. Additionally, added a few useful win32
defcfun
s that aren't used by the high level functionality, but are useful and mirror some of the POSIXdefcfun
s that also aren't used by the high level API. Between theosicat
andosicat-windows
packages, I'm now able to use cl-tar to create a tar file from a directory on Windows and even preserve things like sym and hard links!The only intentional non-Windows behavioral change is in
make-link
. It originally changed the working directory to*d-p-d*
, but that seemed bogus to me for several reasons. First, the current directory is a per-process resource, so it could lead to weird behavior in multi-threaded programs. Second, some implementations have#p""
as the default*d-p-d*
. So I instead calledmerge-pathnames
explicitly instead of relying on the working directory.Some future directions for improvement: