.\" DO NOT MODIFY THIS FILE! It was generated by setup.py 1.2. .TH UTILS 3 "21 March 2023" "NFStest 3.2" "utils 1.0" .SH NAME nfstest.utils - Utilities module .SH DESCRIPTION Definition for common classes and constants .SH CLASSES .SS class SparseFile(baseobj.BaseObj) .nf SparseFile object SparseFile() -> New sparse file object Usage: # Create definition for a sparse file of size 10000 having # two holes of size 1000 at offsets 3000 and 6000 x = SparseFile("/mnt/t/file1", 10000, [3000, 6000], 1000) # Object attributes defined after creation using the above # sample data: # endhole: set to True if the file ends with a hole # Above example ends with data so, # x.endhole = False # data_offsets: list of data segment offsets # x.data_offsets = [0, 4000, 7000] # hole_offsets: list of hole segment offsets including the # implicit hole at the end of the file # x.hole_offsets = [3000, 6000, 10000] # sparse_data: list of data/hole segments, each item in the list # has the following format [offset, size, type] # x.sparse_data = [[0, 3000, 1], [3000, 1000, 0], [4000, 2000, 1], # [6000, 1000, 0], [7000, 3000, 1]] .P .B Methods defined here: --------------------- .P .B __init__(self, absfile, file_size, hole_list, hole_size) Create sparse file object definition, the file is not created just the object. Object attributes are defined which makes it easy to create the actual file. .RS .TP .B absfile: Absolute path name of file .TP .B file_size: Total size of sparse file .TP .B hole_list: List of hole offsets .TP .B hole_size: Size for each hole .RE .fi .SH FUNCTIONS .nf .B split_path(path) Return list of components in path .SH SEE ALSO .BR baseobj(3) .SH BUGS No known bugs. .SH AUTHOR Jorge Mora (mora@netapp.com)