NovaNET Filesystem I/O (pfnovanet)

Utility for accessing PLATO packs and master files.

Copyright (c) 2021-2024 Steve Zoppi

This is licensed software a copy of the license should have been included in the source tree for this module. You may find a copy of the license here: https://www.gnu.org/licenses/gpl-3.0.en.html

This program operates on PLATO packs and master files. Packs are accessed as DtCyber disk images. Master files (CDC style virtual packs) can be accessed directly (if you have a master file image copy available) or as NOS files contained in a NOS disk image.

<Documentation_reference>

When accessing PLATO file structures, the host pack object needs to be instantiated and then the PlatoFile class may be used to access the underlying structure.

class pfnovanet.BackupDiskDevice(rootpath: str, packname: str)[source]

Bases: NovaNetDiskDevice

Backup container file on host filesystem.

The Backup version of the container is the host-based representation of a PLATO pack.

This container doesn’t need to know much other than how to navigate the host filesystem. Most of the hard work is performed by the PlatoFile (Plato File) class.

packname

Name of pack container, master file, or PLATO pack.

Type:

str

packtype

Type of pack (as recorded in the pack directory)

Type:

str

pack_struct

A single character: “n”.

Type:

str

pack_depth

Maximum subdirectory depth to target file.

Type:

int

max_names

Maximum File Names as determined by the Pack_Info property file.

Type:

int

max_parts

Maximum File Parts as determined by the Pack_Info property file.

Type:

int

model

Container Model as determined by the Pack_Info property file.

Type:

int

serial

Disk Serial Number as determined by the Pack_Info property file.

Type:

str

packdirectory

Pointer to the PackDirectory Object.

Type:

PlatoPackDirectory

load_packdirectory(platopd: PlatoPackDirectory)[source]
class pfnovanet.NovaNetDiskDevice(rootpath: str | Path, packname: str, s_pd: str = 'PackDir', s_pi: str = 'Pack_Info')[source]

Bases: object

NovaNET container file on host filesystem.

The NovaNET version of the container is the host-based representation of a PLATO pack.

This container doesn’t need to know much other than how to navigate the host filesystem. Most of the hard work is performed by the PlatoFile (Plato File) class.

The structure of a “Virtual Pack” on a host filesystem is:

(disk root)
    (pack name)
        Pack_Info
        PackDir
        (Level1_Letter)
            (Level2_Letter)
                ... (Leveln_Letter)
                        <filename> | <filename>.gz
    (binary_pack)   Full Container - b64 format
                    pack directory:
                    header: starting byte offset 0x7800
                    bitmap: starting byte offset 0x7800
                            offset 5QW @ 0x7828
                            bitmap (signature 0x0403)
                            256MB (268,800,000 bytes)
                            0o2001310000 bytes
                            0x10059000 bytes

Pack_Info file contains virtual disk properties:

packname

Name of pack container, master file, or PLATO pack.

Type:

str

packtype

Type of pack (as recorded in the pack directory)

Type:

str

pack_struct

A single character: “n”.

Type:

str

pack_depth

Maximum subdirectory depth to target file.

Type:

int

max_names

Maximum File Names as determined by the Pack_Info property file.

Type:

int

max_parts

Maximum File Parts as determined by the Pack_Info property file.

Type:

int

model

Container Model as determined by the Pack_Info property file.

Type:

int

serial

Disk Serial Number as determined by the Pack_Info property file.

Type:

str

packdirectory

Pointer to the PackDirectory Object.

Type:

PlatoPackDirectory

dump_ident() None[source]
get_nnpathname(filename: str) tuple[source]

Create the NovaNET Path Name for a given file

Returns:

original filename requested path_to_file: host filesystem path to the file isgzip: indicates whether the file is compressed.

Return type:

filename

Raises:

FileNotFoundError

load_packinformation() dict[source]