-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix #3023 make expandSymlink work on Windows #17289
Conversation
see bug8 from #16784:
ie, it should instead call expandSymlink once it's fixed |
let f = open(symlinkSrc, fmWrite) | ||
f.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I don't understand this; you're creating a file
"D20210101T1920_nonexistant"
(nonexistant should indicate it doesn't exist) - generated files should go under buildDir (which is gitignored), but
symlinkSrc
is not
simply use:
const symlinkFile = buildDir/"D20210101T191320_BROKEN_SYMLINK"
const symlinkSrc = "nonexistant"
createSymlink(symlinkSrc, symlinkFile)
doAssert expandSymlink(symlinkFile) == symlinkSrc
if not symlinkExists(symlinkPath): | ||
raise newException(OSError, symlinkPath & " is not symlink or does not exist") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not symlinkExists(symlinkPath): | |
raise newException(OSError, symlinkPath & " is not symlink or does not exist") |
because it's redundant with the check a few lines below:
if handle == INVALID_HANDLE_VALUE:
raiseOSError(osLastError(), symlinkPath)
unless i'm missing something
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
fix #3023
followup
expandFileName
should useGetFinalPathNameByHandleW
too.