equal
deleted
inserted
replaced
29 raise OSError(errno.EINVAL, 'Hardlinking not supported') |
29 raise OSError(errno.EINVAL, 'Hardlinking not supported') |
30 |
30 |
31 def _getfileinfo(pathname): |
31 def _getfileinfo(pathname): |
32 """Return number of hardlinks for the given file.""" |
32 """Return number of hardlinks for the given file.""" |
33 try: |
33 try: |
34 fh = win32file.CreateFile(pathname, |
34 fh = win32file.CreateFile(pathname, 0, |
35 win32file.GENERIC_READ, win32file.FILE_SHARE_READ, |
35 win32file.FILE_SHARE_READ | win32file.FILE_SHARE_WRITE | |
|
36 win32file.FILE_SHARE_DELETE, |
36 None, win32file.OPEN_EXISTING, 0, None) |
37 None, win32file.OPEN_EXISTING, 0, None) |
37 except pywintypes.error: |
38 except pywintypes.error: |
38 raise OSError(errno.ENOENT, 'The system cannot find the file specified') |
39 raise OSError(errno.ENOENT, 'The system cannot find the file specified') |
39 try: |
40 try: |
40 return win32file.GetFileInformationByHandle(fh) |
41 return win32file.GetFileInformationByHandle(fh) |