docstring stringlengths 52 499 | function stringlengths 67 35.2k | __index_level_0__ int64 52.6k 1.16M |
|---|---|---|
Create a new Rock Ridge Alternate Name record.
Parameters:
rr_name - The name for the new record.
Returns:
Nothing. | def new(self, rr_name):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('NM record already initialized!')
self.posix_name = rr_name
self.posix_name_flags = 0
self._initialized = True | 511,045 |
Generate a string representing the Rock Ridge Alternate Name record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('NM record not yet initialized!')
return b'NM' + struct.pack(b'=BBB', RRNMRecord.length(self.posix_name), SU_ENTRY_VERSION, self.posix_name_flags) + self.posix_name | 511,046 |
Parse a Rock Ridge Child Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | def parse(self, rrstr):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('CL record already initialized!')
# We assume that the caller has already checked the su_entry_version,
# so we don't bother.
(su_len, su_entry... | 511,047 |
Create a new Rock Ridge Child Link record.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('CL record already initialized!')
self.child_log_block_num = 0 # This gets set later
self._initialized = True | 511,048 |
Generate a string representing the Rock Ridge Child Link record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('CL record not yet initialized!')
return b'CL' + struct.pack('=BBLL', RRCLRecord.length(), SU_ENTRY_VERSION, self.child_log_block_num, utils.swab_32bit(self.child_log... | 511,049 |
Set the logical block number for the child.
Parameters:
bl - Logical block number of the child.
Returns:
Nothing. | def set_log_block_num(self, bl):
# type: (int) -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('CL record not yet initialized!')
self.child_log_block_num = bl | 511,050 |
Parse a Rock Ridge Parent Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | def parse(self, rrstr):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('PL record already initialized!')
# We assume that the caller has already checked the su_entry_version,
# so we don't bother.
(su_len, su_entry... | 511,051 |
Generate a string representing the Rock Ridge Parent Link record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('PL record already initialized!')
self.parent_log_block_num = 0 # This will get set later
self._initialized = True | 511,052 |
Generate a string representing the Rock Ridge Child Link record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('PL record not yet initialized!')
return b'PL' + struct.pack('=BBLL', RRPLRecord.length(), SU_ENTRY_VERSION, self.parent_log_block_num, utils.swab_32bit(self.parent_l... | 511,053 |
Set the logical block number for the parent.
Parameters:
bl - Logical block number of the parent.
Returns:
Nothing. | def set_log_block_num(self, bl):
# type: (int) -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('PL record not yet initialized!')
self.parent_log_block_num = bl | 511,054 |
Parse a Rock Ridge Time Stamp record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | def parse(self, rrstr):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('TF record already initialized!')
# We assume that the caller has already checked the su_entry_version,
# so we don't bother.
(su_len, su_entry... | 511,056 |
Create a new Rock Ridge Time Stamp record.
Parameters:
time_flags - The flags to use for this time stamp record.
Returns:
Nothing. | def new(self, time_flags):
# type: (int) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('TF record already initialized!')
self.time_flags = time_flags
tflen = 7
if self.time_flags & (1 << 7):
tflen = 17
for in... | 511,057 |
Generate a string representing the Rock Ridge Time Stamp record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('TF record not yet initialized!')
outlist = [b'TF', struct.pack('=BBB', RRTFRecord.length(self.time_flags), SU_ENTRY_VERSION, self.time_flags)]
for fieldname ... | 511,058 |
Static method to return the length of the Rock Ridge Time Stamp
record.
Parameters:
time_flags - Integer representing the flags to use.
Returns:
The length of this record in bytes. | def length(time_flags):
# type: (int) -> int
tf_each_size = 7
if time_flags & (1 << 7):
tf_each_size = 17
time_flags &= 0x7f
tf_num = 0
while time_flags:
time_flags &= time_flags - 1
tf_num += 1
return 5 + tf_each_size... | 511,059 |
Parse a Rock Ridge Sparse File record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | def parse(self, rrstr):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('SF record already initialized!')
# We assume that the caller has already checked the su_entry_version,
# so we don't bother.
(su_len, su_entry... | 511,061 |
Create a new Rock Ridge Sparse File record.
Parameters:
file_size_high - The high-order 32-bits of the file size.
file_size_low - The low-order 32-bits of the file size.
table_depth - The maximum virtual file size.
Returns:
Nothing. | def new(self, file_size_high, file_size_low, table_depth):
# type: (Optional[int], int, Optional[int]) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('SF record already initialized!')
self.virtual_file_size_high = file_size_high
self.virtu... | 511,062 |
Generate a string representing the Rock Ridge Sparse File record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('SF record not yet initialized!')
length = 12
if self.virtual_file_size_high is not None:
length = 21
ret = b'SF' + struct.pack('=BB', len... | 511,063 |
Generate a string representing the Rock Ridge Relocated Directory
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('RE record not yet initialized!')
return b'RE' + struct.pack('=BB', RRRERecord.length(), SU_ENTRY_VERSION) | 511,064 |
Parse a Rock Ridge System Terminator record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | def parse(self, rrstr):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('ST record already initialized!')
(su_len, su_entry_version_unused) = struct.unpack_from('=BB', rrstr[:4], 2)
# We assume that the caller has already c... | 511,065 |
Generate a string representing the Rock Ridge System Terminator
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('ST record not yet initialized!')
return b'ST' + struct.pack('=BB', RRSTRecord.length(), SU_ENTRY_VERSION) | 511,066 |
Parse a Rock Ridge Platform Dependent record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | def parse(self, rrstr):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('PD record already initialized!')
(su_len_unused, su_entry_version_unused) = struct.unpack_from('=BB', rrstr[:4], 2)
self.padding = rrstr[4:]
... | 511,067 |
Create a new Rock Ridge Platform Dependent record.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('PD record already initialized!')
self._initialized = True
self.padding = b'' | 511,068 |
Generate a string representing the Rock Ridge Platform Dependent
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('PD record not yet initialized!')
return b'PD' + struct.pack('=BB', RRPDRecord.length(self.padding),
SU_ENTRY_VERSION) + self.paddi... | 511,069 |
An internal method to tell if we have already parsed an entry of the
named type.
Parameters:
name - The name of the entry to check.
Returns:
True if we have already parsed an entry of the named type, False otherwise. | def has_entry(self, name):
# type: (str) -> bool
return getattr(self.dr_entries, name) or getattr(self.ce_entries, name) | 511,072 |
Return a string representing the Rock Ridge entry.
Parameters:
entries - The dr_entries or ce_entries to generate a record for.
Returns:
A string representing the Rock Ridge entry. | def _record(self, entries):
# type: (RockRidgeEntries) -> bytes
outlist = []
if entries.sp_record is not None:
outlist.append(entries.sp_record.record())
if entries.rr_record is not None:
outlist.append(entries.rr_record.record())
for nm_record... | 511,074 |
Return a string representing the Rock Ridge entries in the Directory Record.
Parameters:
None.
Returns:
A string representing the Rock Ridge entry. | def record_dr_entries(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
return self._record(self.dr_entries) | 511,075 |
Return a string representing the Rock Ridge entries in the Continuation Entry.
Parameters:
None.
Returns:
A string representing the Rock Ridge entry. | def record_ce_entries(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
return self._record(self.ce_entries) | 511,076 |
An internal method to add a new length to a Continuation Entry. If the
Continuation Entry does not yet exist, this method creates it.
Parameters:
curr_dr_len - The current Directory Record length.
thislen - The new length to add to the Continuation Entry.
Returns:
An... | def _add_ce_record(self, curr_dr_len, thislen):
# type: (int, int) -> int
if self.dr_entries.ce_record is None:
self.dr_entries.ce_record = RRCERecord()
self.dr_entries.ce_record.new()
curr_dr_len += RRCERecord.length()
self.dr_entries.ce_record.add_r... | 511,077 |
An internal method to add the appropriate symlink record(s) to the ISO.
Parameters:
symlink_path - The absolute symlink path to add to the ISO.
curr_dr_len - The current directory record length.
Returns:
The new directory record length. | def _new_symlink(self, symlink_path, curr_dr_len):
# type: (bytes, int) -> int
# This is more complicated than I realized. There are up to 3 layers
# of maximum length:
# 1. If we are still using the directory record, then we are
# subject to the maximum length lef... | 511,078 |
An internal method to add the appropriate name records to the ISO.
Parameters:
rr_name - The Rock Ridge name to add to the ISO.
curr_dr_len - The current directory record length.
Returns:
The new directory record length. | def _add_name(self, rr_name, curr_dr_len):
# type: (bytes, int) -> int
# The length we are putting in this object (as opposed to the
# continuation entry) is the maximum, minus how much is already in the
# DR, minus 5 for the NM metadata. We know that at least part of the
... | 511,079 |
Increment the number of POSIX file links on this entry by one.
Parameters:
None.
Returns:
Nothing. | def add_to_file_links(self):
# type: () -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
if self.dr_entries.px_record is None:
if self.ce_entries.px_record is None:
raise py... | 511,081 |
Copy the number of file links from the source Rock Ridge entry into
this Rock Ridge entry.
Parameters:
src - The source Rock Ridge entry to copy from.
Returns:
Nothing. | def copy_file_links(self, src):
# type: (RockRidge) -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
# First, get the src data
if src.dr_entries.px_record is None:
if src.ce_entries... | 511,082 |
Get the POSIX file mode bits for this Rock Ridge entry.
Parameters:
None.
Returns:
The POSIX file mode bits for this Rock Ridge entry. | def get_file_mode(self):
# type: () -> int
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
if self.dr_entries.px_record is None:
if self.ce_entries.px_record is None:
raise pycdlib... | 511,083 |
Get the path as a string of the symlink target of this Rock Ridge entry
(if this is a symlink).
Parameters:
None.
Returns:
Symlink path as a string. | def symlink_path(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
if not self.is_symlink():
raise pycdlibexception.PyCdlibInvalidInput('Entry is not a symlink!')
... | 511,085 |
Determine whether this Rock Ridge entry has a child link record (used
for relocating deep directory records).
Parameters:
None.
Returns:
True if this Rock Ridge entry has a child link record, False otherwise. | def child_link_record_exists(self):
# type: () -> bool
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
return self.dr_entries.cl_record is not None or self.ce_entries.cl_record is not None | 511,086 |
Update the logical extent number stored in the child link record (if
there is one), from the directory record entry that was stored in
the child_link member. This is used at the end of reshuffling extents
to properly update the child link records.
Parameters:
None.
Ret... | def child_link_update_from_dirrecord(self):
# type: () -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
if self.cl_to_moved_dr is None:
raise pycdlibexception.PyCdlibInvalidInput('No child ... | 511,087 |
Get the extent of the child of this entry if it has one.
Parameters:
None.
Returns:
The logical block number of the child if it exists. | def child_link_extent(self):
# type: () -> int
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
if self.dr_entries.cl_record is not None:
return self.dr_entries.cl_record.child_log_block_num
... | 511,088 |
Determine whether this Rock Ridge entry has a parent link record (used
for relocating deep directory records).
Parameters:
None:
Returns:
True if this Rock Ridge entry has a parent link record, False otherwise. | def parent_link_record_exists(self):
# type: () -> bool
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
return self.dr_entries.pl_record is not None or self.ce_entries.pl_record is not None | 511,089 |
Update the logical extent number stored in the parent link record (if
there is one), from the directory record entry that was stored in
the parent_link member. This is used at the end of reshuffling extents
to properly update the parent link records.
Parameters:
None.
... | def parent_link_update_from_dirrecord(self):
# type: () -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
if self.parent_link is None:
raise pycdlibexception.PyCdlibInvalidInput('No parent l... | 511,090 |
Get the extent of the parent of this entry if it has one.
Parameters:
None.
Returns:
The logical block number of the parent if it exists. | def parent_link_extent(self):
# type: () -> int
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
if self.dr_entries.pl_record is not None:
return self.dr_entries.pl_record.parent_log_block_num
... | 511,091 |
Determine whether this Rock Ridge entry has a relocated record (used for
relocating deep directory records).
Parameters:
None.
Returns:
True if this Rock Ridge entry has a relocated record, False otherwise. | def relocated_record(self):
# type: () -> bool
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
return self.dr_entries.re_record is not None or self.ce_entries.re_record is not None | 511,092 |
Update the Continuation Entry block object used by this Rock Ridge Record.
Parameters:
block - The new block object.
Returns:
Nothing. | def update_ce_block(self, block):
# type: (RockRidgeContinuationBlock) -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')
self.ce_block = block | 511,093 |
Track an already allocated entry in this Rock Ridge Continuation Block.
Parameters:
offset - The offset at which to place the entry.
length - The length of the entry to track.
Returns:
Nothing. | def track_entry(self, offset, length):
# type: (int, int) -> None
newlen = offset + length - 1
for entry in self._entries:
thislen = entry.offset + entry.length - 1
overlap = range(max(entry.offset, offset), min(thislen, newlen) + 1)
if overlap:
... | 511,096 |
Add a new entry to this Rock Ridge Continuation Block. This method
attempts to find a gap that fits the new length anywhere within this
Continuation Block. If successful, it returns the offset at which
it placed this entry. If unsuccessful, it returns None.
Parameters:
lengt... | def add_entry(self, length):
# type: (int) -> int
offset = -1
# Need to find a gap
for index, entry in enumerate(self._entries):
if index == 0:
if entry.offset != 0 and length <= entry.offset:
# We can put it at the beginning!
... | 511,097 |
Given an offset and length, find and remove the entry in this block
that corresponds.
Parameters:
offset - The offset of the entry to look for.
length - The length of the entry to look for.
Returns:
Nothing. | def remove_entry(self, offset, length):
# type: (int, int) -> None
for index, entry in enumerate(self._entries):
if entry.offset == offset and entry.length == length:
del self._entries[index]
break
else:
raise pycdlibexception.PyCd... | 511,098 |
Calculate the CRC over a range of bytes using the CCITT polynomial.
Parameters:
data - The array of bytes to calculate the CRC over.
Returns:
The CCITT CRC of the data. | def crc_ccitt(data):
# type: (bytes) -> int
crc = 0
if not have_py_3:
for x in data:
crc = crc_ccitt_table[ord(x) ^ ((crc >> 8) & 0xFF)] ^ ((crc << 8) & 0xFF00) # type: ignore
else:
mv = memoryview(data)
for x in mv.tobytes():
crc = crc_ccitt_table[x... | 511,099 |
Internal function to create a zero-padded Identifier byte string from a
source string.
Parameters:
src - The src string to start from.
fulllen - The padded out length of the result.
Returns:
A full identifier byte string containing the source string. | def _ostaunicode_zero_pad(src, fulllen):
# type: (str, int) -> bytes
byte_src = _ostaunicode(src)
return byte_src + b'\x00' * (fulllen - 1 - len(byte_src)) + (struct.pack('=B', len(byte_src))) | 511,101 |
A method to compute a simple checksum over the given data.
Parameters:
data - The data to compute the checksum over.
Returns:
The checksum. | def _compute_csum(data):
# type: (bytes) -> int
def identity(x):
# type: (int) -> int
return x
if isinstance(data, str):
myord = ord
elif isinstance(data, bytes):
myord = identity
elif isinstance(data, bytearray):
myord = identity
csum = 0
... | 511,102 |
A function to generate UDF symlink data from a Unix-like path.
Parameters:
symlink_target - The Unix-like path that is the symlink.
Returns:
The UDF data corresponding to the symlink. | def symlink_to_bytes(symlink_target):
# type: (str) -> bytes
symlink_data = bytearray()
for comp in symlink_target.split('/'):
if comp == '':
# If comp is empty, then we know this is the leading slash
# and we should make an absolute entry (double slashes and
... | 511,103 |
A method to set the new location for this UDF BEA Volume Structure.
Parameters:
extent - The new extent location to set for this UDF BEA Volume Structure.
Returns:
Nothing. | def set_extent_location(self, extent):
# type: (int) -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('This Volume Descriptor is not yet initialized')
self.new_extent_loc = extent | 511,104 |
Parse the passed in data into a UDF NSR Volume Structure.
Parameters:
data - The data to parse.
extent - The extent that this descriptor currently lives at.
Returns:
Nothing. | def parse(self, data, extent):
# type: (bytes, int) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF NSR Volume Structure already initialized')
(structure_type, self.standard_ident, structure_version,
reserved_unused) = struct.unpack_f... | 511,105 |
A method to generate the string representing this UDF NSR Volume
Structure.
Parameters:
None.
Returns:
A string representing this UDF BEA Volume Strucutre. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF NSR Volume Structure not initialized')
return struct.pack(self.FMT, 0, self.standard_ident, 1, b'\x00' * 2041) | 511,106 |
A method to create a new UDF NSR Volume Structure.
Parameters:
None.
Returns:
Nothing. | def new(self, version):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF NSR Volume Structure already initialized')
if version == 2:
self.standard_ident = b'NSR02'
elif version == 3:
self.standard_iden... | 511,107 |
A method to get the extent location of this UDF NSR Volume Structure.
Parameters:
None.
Returns:
Integer extent location of this UDF NSR Volume Structure. | def extent_location(self):
# type: () -> int
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF NSR Volume Structure not yet initialized')
if self.new_extent_loc < 0:
return self.orig_extent_loc
return self.new_extent_loc | 511,108 |
Parse the passed in data into a UDF Descriptor tag.
Parameters:
data - The data to parse.
extent - The extent to compare against for the tag location.
Returns:
Nothing. | def parse(self, data, extent):
# type: (bytes, int) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Tag already initialized')
(self.tag_ident, self.desc_version, tag_checksum, reserved,
self.tag_serial_number, desc_crc, self.desc_crc_... | 511,109 |
A method to generate the string representing this UDF Descriptor Tag.
Parameters:
crc_bytes - The string to compute the CRC over.
Returns:
A string representing this UDF Descriptor Tag. | def record(self, crc_bytes):
# type: (bytes) -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Descriptor Tag not initialized')
crc_byte_len = len(crc_bytes)
if self.desc_crc_length >= 0:
crc_byte_len = self.desc_crc_len... | 511,110 |
A method to create a new UDF Descriptor Tag.
Parameters:
tag_ident - The tag identifier number for this tag.
tag_serial - The tag serial number for this tag.
Returns:
Nothing | def new(self, tag_ident, tag_serial=0):
# type: (int, int) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Tag already initialized')
self.tag_ident = tag_ident
self.desc_version = 2
self.tag_serial_number = tag_serial
s... | 511,111 |
Parse the passed in data into a UDF Anchor Volume Structure.
Parameters:
data - The data to parse.
extent - The extent that this descriptor currently lives at.
desc_tag - A UDFTag object that represents the Descriptor Tag.
Returns:
Nothing. | def parse(self, data, extent, desc_tag):
# type: (bytes, int, UDFTag) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('Anchor Volume Structure already initialized')
(tag_unused, self.main_vd_length, self.main_vd_extent,
self.reserve_vd_len... | 511,112 |
A method to generate the string representing this UDF Anchor Volume
Structure.
Parameters:
None.
Returns:
A string representing this UDF Anchor Volume Structure. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Anchor Volume Descriptor not initialized')
rec = struct.pack(self.FMT, b'\x00' * 16, self.main_vd_length,
self.main_vd_extent, self.res... | 511,113 |
A method to create a new UDF Anchor Volume Structure.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Anchor Volume Structure already initialized')
self.desc_tag = UDFTag()
self.desc_tag.new(2) # FIXME: we should let the user set serial_number
self.main_... | 511,114 |
A method to set a new location for this Anchor Volume Structure.
Parameters:
new_location - The new extent that this Anchor Volume Structure should be located at.
main_vd_extent - The extent containing the main Volume Descriptors.
reserve_vd_extent - The extent containing the reserve... | def set_extent_location(self, new_location, main_vd_extent, reserve_vd_extent):
# type: (int, int, int) -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Anchor Volume Structure not yet initialized')
self.new_extent_loc = new_location
... | 511,115 |
Parse the passed in data into a UDF Timestamp.
Parameters:
data - The data to parse.
Returns:
Nothing. | def parse(self, data):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Timestamp already initialized')
(tz, timetype, self.year, self.month, self.day, self.hour, self.minute,
self.second, self.centiseconds, self.hundre... | 511,116 |
A method to generate the string representing this UDF Timestamp.
Parameters:
None.
Returns:
A string representing this UDF Timestamp. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Timestamp not initialized')
tmp = ((1 << 16) - 1) & self.tz
newtz = tmp & 0xff
newtimetype = ((tmp >> 8) & 0x0f) | (self.timetype << 4)
... | 511,117 |
A method to create a new UDF Timestamp.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Timestamp already initialized')
tm = time.time()
local = time.localtime(tm)
self.tz = utils.gmtoffset_from_tm(tm, local)
# FIXME: for the timety... | 511,118 |
Parse the passed in data into a UDF Entity ID.
Parameters:
data - The data to parse.
Returns:
Nothing. | def parse(self, data):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Entity ID already initialized')
(self.flags, self.identifier, self.suffix) = struct.unpack_from(self.FMT, data, 0)
self._initialized = True | 511,119 |
A method to generate the string representing this UDF Entity ID.
Parameters:
None.
Returns:
A string representing this UDF Entity ID. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Entity ID not initialized')
return struct.pack(self.FMT, self.flags, self.identifier, self.suffix) | 511,120 |
A method to create a new UDF Entity ID.
Parameters:
flags - The flags to set for this Entity ID.
identifier - The identifier to set for this Entity ID.
suffix - The suffix to set for this Entity ID.
None.
Returns:
Nothing. | def new(self, flags=0, identifier=b'', suffix=b''):
# type: (int, bytes, bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Entity ID already initialized')
if len(identifier) > 23:
raise pycdlibexception.PyCdlibInvalidInput('UD... | 511,121 |
Parse the passed in data into a UDF Primary Volume Descriptor.
Parameters:
data - The data to parse.
extent - The extent that this descriptor currently lives at.
desc_tag - A UDFTag object that represents the Descriptor Tag.
Returns:
Nothing. | def parse(self, data, extent, desc_tag):
# type: (bytes, int, UDFTag) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Primary Volume Descriptor already initialized')
(tag_unused, self.vol_desc_seqnum, self.desc_num, self.vol_ident,
vo... | 511,122 |
A method to generate the string representing this UDF Primary Volume
Descriptor.
Parameters:
None.
Returns:
A string representing this UDF Primary Volume Descriptor. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Primary Volume Descriptor not initialized')
rec = struct.pack(self.FMT, b'\x00' * 16,
self.vol_desc_seqnum, self.desc_num,
... | 511,123 |
A method to create a new UDF Primary Volume Descriptor.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Primary Volume Descriptor already initialized')
self.desc_tag = UDFTag()
self.desc_tag.new(1) # FIXME: we should let the user set serial_number
self.vo... | 511,124 |
Parse the passed in data into a UDF Implementation Use Volume
Descriptor Implementation Use field.
Parameters:
data - The data to parse.
Returns:
Nothing. | def parse(self, data):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Implementation Use Volume Descriptor Implementation Use field already initialized')
(self.char_set, self.log_vol_ident, self.lv_info1, self.lv_info2,
... | 511,125 |
A method to generate the string representing this UDF Implementation Use
Volume Descriptor Implementation Use field.
Parameters:
None.
Returns:
A string representing this UDF Implementation Use Volume Descriptor. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Implementation Use Volume Descriptor Implementation Use field not initialized')
return struct.pack(self.FMT, self.char_set, self.log_vol_ident,
... | 511,126 |
A method to create a new UDF Implementation Use Volume Descriptor Implementation Use field.
Parameters:
None:
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Implementation Use Volume Descriptor Implementation Use field already initialized')
self.char_set = _unicodecharset()
self.log_vol_ident = _ostaunicode_zero_pad(... | 511,127 |
Parse the passed in data into a UDF Implementation Use Volume
Descriptor.
Parameters:
data - The data to parse.
extent - The extent that this descriptor currently lives at.
desc_tag - A UDFTag object that represents the Descriptor Tag.
Returns:
Nothing. | def parse(self, data, extent, desc_tag):
# type: (bytes, int, UDFTag) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Implementation Use Volume Descriptor already initialized')
(tag_unused, self.vol_desc_seqnum, impl_ident,
impl_use) ... | 511,128 |
A method to create a new UDF Implementation Use Volume Descriptor.
Parameters:
None:
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Implementation Use Volume Descriptor already initialized')
self.desc_tag = UDFTag()
self.desc_tag.new(4) # FIXME: we should let the user set serial_number
... | 511,129 |
Parse the passed in data into a UDF Partition Header Descriptor.
Parameters:
data - The data to parse.
Returns:
Nothing. | def parse(self, data):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Partition Header Descriptor already initialized')
(unalloc_table_length, unalloc_table_pos, unalloc_bitmap_length,
unalloc_bitmap_pos, part_integrit... | 511,130 |
Parse the passed in data into a UDF Partition Volume Descriptor.
Parameters:
data - The data to parse.
extent - The extent that this descriptor currently lives at.
desc_tag - A UDFTag object that represents the Descriptor Tag.
Returns:
Nothing. | def parse(self, data, extent, desc_tag):
# type: (bytes, int, UDFTag) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Partition Volume Descriptor already initialized')
(tag_unused, self.vol_desc_seqnum, self.part_flags, self.part_num,
... | 511,131 |
A method to generate the string representing this UDF Partition Volume
Descriptor.
Parameters:
None.
Returns:
A string representing this UDF Partition Volume Descriptor. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Partition Volume Descriptor not initialized')
rec = struct.pack(self.FMT, b'\x00' * 16,
self.vol_desc_seqnum, self.part_flags,
... | 511,132 |
A method to create a new UDF Partition Volume Descriptor.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Partition Volume Descriptor already initialized')
self.desc_tag = UDFTag()
self.desc_tag.new(5) # FIXME: we should let the user set serial_number
self.... | 511,133 |
A method to set the location of the start of the partition.
Parameters:
new_location - The new extent the UDF partition should start at.
Returns:
Nothing. | def set_start_location(self, new_location):
# type: (int) -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Partition Volume Descriptor not initialized')
self.part_start_location = new_location | 511,134 |
Parse the passed in data into a UDF Partition Map.
Parameters:
data - The data to parse.
Returns:
Nothing. | def parse(self, data):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Partition Map already initialized')
(map_type, map_length, vol_seqnum,
self.part_num) = struct.unpack_from(self.FMT, data, 0)
if map_type ... | 511,135 |
A method to create a new UDF Partition Map.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Partition Map already initialized')
self.part_num = 0 # FIXME: we should let the user set this
self._initialized = True | 511,136 |
Parse the passed in data into a UDF Long AD.
Parameters:
data - The data to parse.
Returns:
Nothing. | def parse(self, data):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Long Allocation descriptor already initialized')
(self.extent_length, self.log_block_num, self.part_ref_num,
self.impl_use) = struct.unpack_from(sel... | 511,137 |
A method to generate the string representing this UDF Long AD.
Parameters:
None.
Returns:
A string representing this UDF Long AD. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Long AD not initialized')
return struct.pack(self.FMT, self.extent_length, self.log_block_num,
self.part_ref_num, self.impl_use) | 511,138 |
A method to create a new UDF Long AD.
Parameters:
None.
Returns:
Nothing. | def new(self, length, blocknum):
# type: (int, int) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Long AD already initialized')
self.extent_length = length
self.log_block_num = blocknum
self.part_ref_num = 0 # FIXME: we shou... | 511,139 |
A method to set the location fields of this UDF Long AD.
Parameters:
new_location - The new relative extent that this UDF Long AD references.
tag_location - The new absolute extent that this UDF Long AD references.
Returns:
Nothing. | def set_extent_location(self, new_location, tag_location):
# type: (int, int) -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Long AD not initialized')
self.log_block_num = tag_location
self.impl_use = b'\x00\x00' + struct.pack('=L... | 511,140 |
Parse the passed in data into a UDF Logical Volume Descriptor.
Parameters:
data - The data to parse.
extent - The extent that this descriptor currently lives at.
desc_tag - A UDFTag object that represents the Descriptor Tag.
Returns:
Nothing. | def parse(self, data, extent, desc_tag):
# type: (bytes, int, UDFTag) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Descriptor already initialized')
(tag_unused, self.vol_desc_seqnum, self.desc_char_set,
self.logical_... | 511,141 |
A method to generate the string representing this UDF Logical Volume Descriptor.
Parameters:
None.
Returns:
A string representing this UDF Logical Volume Descriptor. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Descriptor not initialized')
rec = struct.pack(self.FMT, b'\x00' * 16,
self.vol_desc_seqnum, self.desc_char_set,
... | 511,142 |
A method to create a new UDF Logical Volume Descriptor.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Descriptor already initialized')
self.desc_tag = UDFTag()
self.desc_tag.new(6) # FIXME: we should let the user set serial_number
self.vo... | 511,143 |
A method to set the location of the UDF Integrity sequence that this descriptor references.
Parameters:
integrity_extent - The new extent that the UDF Integrity sequence should start at.
Returns:
Nothing. | def set_integrity_location(self, integrity_extent):
# type: (int) -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Descriptor not initialized')
self.integrity_sequence_extent = integrity_extent | 511,144 |
Parse the passed in data into a UDF Unallocated Space Descriptor.
Parameters:
data - The data to parse.
extent - The extent that this descriptor currently lives at.
desc_tag - A UDFTag object that represents the Descriptor Tag.
Returns:
Nothing. | def parse(self, data, extent, desc_tag):
# type: (bytes, int, UDFTag) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Unallocated Space Descriptor already initialized')
(tag_unused, self.vol_desc_seqnum,
num_alloc_descriptors, end_unu... | 511,145 |
Parse the passed in data into a UDF Terminating Descriptor.
Parameters:
extent - The extent that this descriptor currently lives at.
desc_tag - A UDFTag object that represents the Descriptor Tag.
Returns:
Nothing. | def parse(self, extent, desc_tag):
# type: (int, UDFTag) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Terminating Descriptor already initialized')
self.desc_tag = desc_tag
self.orig_extent_loc = extent
self._initialized = ... | 511,146 |
A method to generate the string representing this UDF Terminating
Descriptor.
Parameters:
None.
Returns:
A string representing this UDF Terminating Descriptor. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Terminating Descriptor not initialized')
rec = struct.pack(self.FMT, b'\x00' * 16, b'\x00' * 496)[16:]
return self.desc_tag.record(rec) + rec | 511,147 |
A method to create a new UDF Terminating Descriptor.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Terminating Descriptor already initialized')
self.desc_tag = UDFTag()
self.desc_tag.new(8) # FIXME: we should let the user set serial_number
self._init... | 511,148 |
A method to set the location of this UDF Terminating Descriptor.
Parameters:
new_location - The new extent this UDF Terminating Descriptor should be located at.
tag_location - The tag location to set for this UDF Terminator Descriptor.
Returns:
Nothing. | def set_extent_location(self, new_location, tag_location=None):
# type: (int, int) -> None
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Terminating Descriptor not initialized')
self.new_extent_loc = new_location
if tag_location is None:... | 511,149 |
Parse the passed in data into a UDF Logical Volume Header Descriptor.
Parameters:
data - The data to parse.
Returns:
Nothing. | def parse(self, data):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Header Descriptor already initialized')
(self.unique_id, reserved_unused) = struct.unpack_from(self.FMT, data, 0)
self._initialized =... | 511,150 |
A method to create a new UDF Logical Volume Header Descriptor.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Header Descriptor already initialized')
self.unique_id = 261
self._initialized = True | 511,151 |
Parse the passed in data into a UDF Logical Volume Implementation Use.
Parameters:
data - The data to parse.
Returns:
Nothing. | def parse(self, data):
# type: (bytes) -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Implementation Use already initialized')
(impl_id, self.num_files, self.num_dirs, self.min_udf_read_revision,
self.min_udf_write_rev... | 511,152 |
A method to generate the string representing this UDF Logical Volume
Implementation Use.
Parameters:
None.
Returns:
A string representing this UDF Logical Volume Implementation Use. | def record(self):
# type: () -> bytes
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Implementation Use not initialized')
return struct.pack(self.FMT, self.impl_id.record(),
self.num_files, self.num_dirs,... | 511,153 |
A method to create a new UDF Logical Volume Implementation Use.
Parameters:
None.
Returns:
Nothing. | def new(self):
# type: () -> None
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Implementation Use already initialized')
self.impl_id = UDFEntityID()
self.impl_id.new(0, b'*pycdlib')
self.num_files = 0
self.nu... | 511,154 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.