1 import os
2 import urllib2
3
4 MAX_CHARS_IN_ONE_LINE = 20000
5
6 __CSL = None
8 '''symlink(source, link_name)
9 Creates a symbolic link pointing to source named link_name'''
10 global __CSL
11 if __CSL is None:
12 import ctypes
13 csl = ctypes.windll.LoadLibrary("kernel32.dll").CreateSymbolicLinkW
14 csl.argtypes = (ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_uint32)
15 csl.restype = ctypes.c_ubyte
16 __CSL = csl
17 flags = 0
18 if source is not None and os.path.isdir(source):
19 flags = 1
20 if __CSL(link_name, source, flags) == 0:
21 raise ctypes.WinError()
22