This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import locale | |
| import struct | |
| def __readLink(path): | |
| # http://stackoverflow.com/a/28952464/1119602 | |
| with open(path, 'rb') as stream: | |
| content = stream.read() | |
| # skip first 20 bytes (HeaderSize and LinkCLSID) | |
| # read the LinkFlags structure (4 bytes) | |
| lflags = struct.unpack('I', content[0x14:0x18])[0] |