[python-win32] win32file.CreateSymbolicLink and SYMLINK_FLAG_DIRECTORY

Devin Jeanpierre jeanpierreda at gmail.com
Tue Jun 16 03:23:33 CEST 2009


I'm new to pywin32 development, but wanted to toy with creating
symlinks (and related new things) with a similar API to the current os
module. The documentation in pywin32 states that the only flag is
"SYMLINK_FLAG_DIRECTORY" (MSDN docs state that in the C++ API, the
only flag is "SYMBOLIC_LINK_FLAG_DIRECTORY"). I don't know where to
find it; the examples that were provided showed flags being in the
same module, such as "win32pdh.PERF_DETAIL_WIZARD", but there is no
win32file.SYMLINK_FLAG_DIRECTORY on my install, nor is there a
win32file.SYMBOLIC_LINK_FLAG_DIRECTORY (in fact, nothing of the form
win32file.SYM*). I could find no dedicated constants/flags module or
submodule. I would appreciate some help finding the constant (for now,
I am using the magic number 1 as described in the MSDN docs).

Also, it appears that CreateSymbolicLink raises an exception in some
failure circumstances (when the location that the symlink would be is
already taken up by something), but not others (when the user doesn't
have the appropriate permissions for creating symbolic links).

Devin Jeanpierre


More information about the python-win32 mailing list