Pro.Lnk — API for parsing Windows Link files¶
Printing the Contents of a Link¶
The following code example demonstrates how to output the contents of a link file:
from Pro.Core import *
from Pro.Lnk import *
def parseLink(fname):
c = createContainerFromFile(fname)
if c.isNull():
return
obj = LnkObject()
if not obj.Load(c) or not obj.Initialize():
return
out = proTextStream()
obj.Dump(out)
print(out.buffer)
Module API¶
Pro.Lnk module API.
Classes:
This class represents a Windows link file.
- class LnkObject¶
Bases:
Pro.Core.CFFObjectThis class represents a Windows link file.
See also
Dump()andGetTarget().Methods:
Dump(out)Dumps the contents of the link to the specifed text stream.
DumpExtraData(out)Dumps the extra data to the specifed text stream.
DumpFileHeader(out)Dumps the file header to the specifed text stream.
DumpLinkInfo(out)Dumps the link information to the specifed text stream.
DumpLinkTargetIDList(out)Dumps the target ID list to the specifed text stream.
DumpStringData(out)Dumps the string data to the specifed text stream.
Returns the target of the link.
Returns
Trueif extra data is present; otherwise returnsFalse.Returns
Trueif link information is present; otherwise returnsFalse.Returns
Trueif a target ID list is present; otherwise returnsFalse.Returns
Trueif string data is present; otherwise returnsFalse.
- Dump(out: Pro.Core.NTTextStream) → None¶
Dumps the contents of the link to the specifed text stream.
- Parameters
out (NTTextStream) – The output text stream.
- DumpExtraData(out: Pro.Core.NTTextStream) → None¶
Dumps the extra data to the specifed text stream.
- Parameters
out (NTTextStream) – The output text stream.
See also
HasExtraData().
- DumpFileHeader(out: Pro.Core.NTTextStream) → None¶
Dumps the file header to the specifed text stream.
- Parameters
out (NTTextStream) – The output text stream.
- DumpLinkInfo(out: Pro.Core.NTTextStream) → None¶
Dumps the link information to the specifed text stream.
- Parameters
out (NTTextStream) – The output text stream.
See also
HasLinkInfo().
- DumpLinkTargetIDList(out: Pro.Core.NTTextStream) → None¶
Dumps the target ID list to the specifed text stream.
- Parameters
out (NTTextStream) – The output text stream.
See also
HasLinkTargetIDList().
- DumpStringData(out: Pro.Core.NTTextStream) → None¶
Dumps the string data to the specifed text stream.
- Parameters
out (NTTextStream) – The output text stream.
See also
HasStringData().
- GetTarget() → str¶
- Returns
Returns the target of the link.
- Return type
str
- HasExtraData() → bool¶
- Returns
Returns
Trueif extra data is present; otherwise returnsFalse.- Return type
bool
See also
DumpExtraData().
- HasLinkInfo() → bool¶
- Returns
Returns
Trueif link information is present; otherwise returnsFalse.- Return type
bool
See also
DumpLinkInfo().
- HasLinkTargetIDList() → bool¶
- Returns
Returns
Trueif a target ID list is present; otherwise returnsFalse.- Return type
bool
See also
DumpLinkTargetIDList().
- HasStringData() → bool¶
- Returns
Returns
Trueif string data is present; otherwise returnsFalse.- Return type
bool
See also
DumpStringData().