Skip to main content

VHD操作库

Project description

vhd

介绍

vhd 是一个用于创建和读取固定大小 VHD (Virtual Hard Disk) 文件的 Python 库。

安装

你可以通过以下命令安装 vhd

pip install vhd

代码例程

创建VHD文件

import vhd
if vhd.create("example.vhd", 512):
    print(f"VHD 文件已创建")

读取 VHD 文件信息

import vhd
filename = "example.vhd"
vhd_info = vhd.read(filename)
print("VHD 文件信息:")
print(f"Cookie: {vhd_info['cookie']}")
print(f"特性: {vhd_info['features']}")
print(f"文件格式版本: {vhd_info['file_format_version']}")
print(f"数据偏移量: {vhd_info['data_offset']}")
print(f"时间戳: {format_timestamp(vhd_info['timestamp'])}")
print(f"创建者应用程序: {vhd_info['creator_application']}")
print(f"创建者版本: {vhd_info['creator_version']}")
print(f"创建者主机操作系统: {vhd_info['creator_host_os']}")
print(f"原始大小: {vhd_info['original_size']} 字节 ({vhd_info['original_size'] / (1024 * 1024):.2f} MB)")
print(f"当前大小: {vhd_info['current_size']} 字节 ({vhd_info['current_size'] / (1024 * 1024):.2f} MB)")
print(f"柱面数: {vhd_info['cylinders']}")
print(f"磁头数: {vhd_info['heads']}")
print(f"每磁道扇区数: {vhd_info['sectors_per_track']}")
print(f"磁盘类型: {vhd_info['disk_type']}")
print(f"校验和: {vhd_info['checksum']}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vhd-1.0.4.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vhd-1.0.4-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file vhd-1.0.4.tar.gz.

File metadata

  • Download URL: vhd-1.0.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for vhd-1.0.4.tar.gz
Algorithm Hash digest
SHA256 c94f8845c8221ec30ab7ac3c9de97593565adbad443a3e9d24960ead23bdc79d
MD5 81cc563ffb5c3dbd818994712620f6c5
BLAKE2b-256 6adbd1296245a73c30049a76a86b30e922b75fdf3bc62b2bdbdcaa68edf61942

See more details on using hashes here.

File details

Details for the file vhd-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: vhd-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for vhd-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ca83cb39e2b9ff0a1cf77db0082c7b7d4aee91f53ee93d4bc7777fb84712f7aa
MD5 2b07400ab192e485cbe33033eabbe9ca
BLAKE2b-256 b4530c9d7722357fd794b11413d8be47c6989b996d12960a8ff1e86c1f334807

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page