UTILS(3)
β¨ UTILS(3) β¨ β nfstest.utils, from the utils 1.0 manual (section 3, bestie π
)
okay so welcome to the utilities module π«Ά this is where the shared stuff lives β the common classes and constants that everything else in the fam borrows. lowkey iconic. π
πΈ NAME πΈ
nfstest.utils β the Utilities module, aka the communal closet everybody raids π
π¦ DESCRIPTION π¦
It's the definition spot for the common classes and constants. That's the whole vibe. No cap. β¨
π CLASSES π
π class SparseFile(baseobj.BaseObj)
The 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]]
π Methods defined here:
<div align="left">---------------------</div>
nah jk, here they are fr fr π
β __init__(self, absfile, file_size, hole_list, hole_size)
This makes the sparse file object definition β and listen, the file is NOT created, only the object, okay bestie? π It just sets up the object attributes so that making the actual file later is, like, effortless. Slay.
absfileβ the absolute path name of the file π«Άfile_sizeβ the total size of the sparse file β¨hole_listβ the list of hole offsets π³οΈhole_sizeβ the size for each hole πΌ
π₯ FUNCTIONS π₯
π« split_path(path)
Returns a list of components in path. That's it, that's the function, and it ate. π
π SEE ALSO π
baseobj(3) β go say hi to the parent, iykyk π§
π BUGS π
No known bugs. not a single one, we're literally flawless rn β¨π
π«Ά AUTHOR π«Ά
Jorge Mora (mora@netapp.com) β the main character who wrote all this ππ
and that's the whole page bestie!! π this was NFStest 3.2, dated 21 March 2023, and yes the utils 1.0 manual really did just get the group-chat treatment. periodt. π
πΈπ¦
π¦ where this page comes from
- debian trixie: nfstest 3.2-3
- fedora 43: NFStest 3.2-14.fc43 Β· GPL-2.0-or-later
- fedora 44: NFStest 3.2-16.fc44 Β· GPL-2.0-or-later
- ubuntu noble: nfstest 3.2-2
- ubuntu questing: nfstest 3.2-3
- ubuntu resolute: nfstest 3.2-3build1
- ubuntu stonking: nfstest 3.2-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms