equal
deleted
inserted
replaced
41 """Return number of hardlinks for the given file.""" |
41 """Return number of hardlinks for the given file.""" |
42 try: |
42 try: |
43 fh = win32file.CreateFile(pathname, |
43 fh = win32file.CreateFile(pathname, |
44 win32file.GENERIC_READ, win32file.FILE_SHARE_READ, |
44 win32file.GENERIC_READ, win32file.FILE_SHARE_READ, |
45 None, win32file.OPEN_EXISTING, 0, None) |
45 None, win32file.OPEN_EXISTING, 0, None) |
46 res = win32file.GetFileInformationByHandle(fh) |
46 try: |
47 fh.Close() |
47 return win32file.GetFileInformationByHandle(fh) |
48 return res |
48 finally: |
|
49 fh.Close() |
49 except pywintypes.error: |
50 except pywintypes.error: |
50 return None |
51 return None |
51 |
52 |
52 def nlinks(pathname): |
53 def nlinks(pathname): |
53 """Return number of hardlinks for the given file.""" |
54 """Return number of hardlinks for the given file.""" |