Task 822: .WTX File Format

Task 822: .WTX File Format

.WTX File Format Specifications

The .WTX file format is the WinTune Exchange file used by WinTune, a legacy benchmark and diagnostic tool developed by Windows Magazine in the 1990s. It is designed to store and exchange system performance test results. The format is plain ASCII text, making it human-readable and easy to transmit (e.g., via email). It contains structured data representing benchmark results from various system components, allowing users to import the data into WinTune for comparison.

WinTune .WTX files are not binary; they are text-based with a key-value style structure, often organized in sections or as simple line-based entries. Each file can contain data for one or more systems, including hardware details and performance metrics. There is no formal header or magic number, as it's text. Manual editing is possible but not recommended, as it could invalidate the data for import into WinTune.

  1. List of all the properties of this file format intrinsic to its file system:
  • System Name: Descriptive name of the tested system.
  • Test Date: Timestamp when the benchmark was run.
  • Operating System: Version of Windows or OS used.
  • CPU Type: Processor model (e.g., Pentium, 486).
  • CPU Speed: Clock speed in MHz.
  • RAM Size: Amount of installed memory in MB.
  • Video Adapter: Graphics card model and details.
  • Disk Drive: Hard drive model and capacity.
  • CPU Integer Performance: Measured in MIPS (Millions of Instructions Per Second).
  • CPU Floating Point Performance: Measured in MFLOPS (Millions of Floating-Point Operations Per Second).
  • Memory Performance: Bandwidth for read/write operations in MB/s.
  • Video Performance: 2D graphics speed in pixels/second or similar units.
  • Disk Performance: Transfer rate in KB/s.
  • Overall Score: Composite benchmark score aggregating all tests.

These properties are stored as key-value pairs (e.g., "CPU Type = Intel Pentium 100") or in delimited sections within the text file.

Two direct download links for files of format .WTX:

Ghost blog embedded HTML JavaScript for drag-and-drop .WTX file dump:

WTX File Dumper

Drag and Drop .WTX File

Drop .WTX file here

This HTML/JS can be embedded in a Ghost blog post. It creates a drag-and-drop zone, reads the .WTX file as text, parses key-value pairs (assuming "key = value" format), and dumps the properties to the screen.

  1. Python class for .WTX file handling:
import os

class WTXHandler:
    def __init__(self, filepath):
        self.filepath = filepath
        self.properties = {}

    def read(self):
        if not os.path.exists(self.filepath):
            print(f"File {self.filepath} does not exist.")
            return
        with open(self.filepath, 'r', encoding='ascii') as f:
            content = f.read()
            lines = content.split('\n')
            for line in lines:
                trimmed = line.strip()
                if ' = ' in trimmed:
                    key, value = trimmed.split(' = ', 1)
                    self.properties[key.strip()] = value.strip()

    def decode(self):
        # Since it's plain text, decoding is just reading as ASCII
        self.read()

    def print_properties(self):
        if not self.properties:
            print("No properties loaded.")
            return
        for key, value in self.properties.items():
            print(f"{key}: {value}")

    def write(self, new_properties):
        with open(self.filepath, 'w', encoding='ascii') as f:
            for key, value in new_properties.items():
                f.write(f"{key} = {value}\n")
        print(f"Properties written to {self.filepath}")

# Example usage:
# handler = WTXHandler('example.wtx')
# handler.decode()
# handler.print_properties()
# new_props = {'CPU Type': 'Intel Pentium', 'CPU Speed': '100 MHz'}
# handler.write(new_props)
  1. Java class for .WTX file handling:
import java.io.*;
import java.util.HashMap;
import java.util.Map;

public class WTXHandler {
    private String filepath;
    private Map<String, String> properties = new HashMap<>();

    public WTXHandler(String filepath) {
        this.filepath = filepath;
    }

    public void read() throws IOException {
        File file = new File(filepath);
        if (!file.exists()) {
            System.out.println("File " + filepath + " does not exist.");
            return;
        }
        try (BufferedReader br = new BufferedReader(new FileReader(file))) {
            String line;
            while ((line = br.readLine()) != null) {
                String trimmed = line.trim();
                if (trimmed.contains(" = ")) {
                    String[] parts = trimmed.split(" = ", 2);
                    properties.put(parts[0].trim(), parts[1].trim());
                }
            }
        }
    }

    public void decode() throws IOException {
        // Plain text, so decode is read
        read();
    }

    public void printProperties() {
        if (properties.isEmpty()) {
            System.out.println("No properties loaded.");
            return;
        }
        for (Map.Entry<String, String> entry : properties.entrySet()) {
            System.out.println(entry.getKey() + ": " + entry.getValue());
        }
    }

    public void write(Map<String, String> newProperties) throws IOException {
        try (BufferedWriter bw = new BufferedWriter(new FileWriter(filepath))) {
            for (Map.Entry<String, String> entry : newProperties.entrySet()) {
                bw.write(entry.getKey() + " = " + entry.getValue());
                bw.newLine();
            }
        }
        System.out.println("Properties written to " + filepath);
    }

    // Example usage:
    // public static void main(String[] args) throws IOException {
    //     WTXHandler handler = new WTXHandler("example.wtx");
    //     handler.decode();
    //     handler.printProperties();
    //     Map<String, String> newProps = new HashMap<>();
    //     newProps.put("CPU Type", "Intel Pentium");
    //     newProps.put("CPU Speed", "100 MHz");
    //     handler.write(newProps);
    // }
}
  1. JavaScript class for .WTX file handling:
class WTXHandler {
    constructor(filepath) {
        this.filepath = filepath;
        this.properties = {};
    }

    // Note: JS in Node.js context; requires fs module
    read() {
        const fs = require('fs');
        if (!fs.existsSync(this.filepath)) {
            console.log(`File ${this.filepath} does not exist.`);
            return;
        }
        const content = fs.readFileSync(this.filepath, 'ascii');
        const lines = content.split('\n');
        lines.forEach(line => {
            const trimmed = line.trim();
            if (trimmed.includes(' = ')) {
                const [key, value] = trimmed.split(' = ', 2);
                this.properties[key.trim()] = value.trim();
            }
        });
    }

    decode() {
        // Plain text, decode is read
        this.read();
    }

    printProperties() {
        if (Object.keys(this.properties).length === 0) {
            console.log('No properties loaded.');
            return;
        }
        for (const [key, value] of Object.entries(this.properties)) {
            console.log(`${key}: ${value}`);
        }
    }

    write(newProperties) {
        const fs = require('fs');
        let content = '';
        for (const [key, value] of Object.entries(newProperties)) {
            content += `${key} = ${value}\n`;
        }
        fs.writeFileSync(this.filepath, content, 'ascii');
        console.log(`Properties written to ${this.filepath}`);
    }
}

// Example usage (in Node.js):
// const handler = new WTXHandler('example.wtx');
// handler.decode();
// handler.printProperties();
// const newProps = { 'CPU Type': 'Intel Pentium', 'CPU Speed': '100 MHz' };
// handler.write(newProps);
  1. C++ class for .WTX file handling (since C has no classes, assuming C++ for "c class"):
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <algorithm>

class WTXHandler {
private:
    std::string filepath;
    std::map<std::string, std::string> properties;

public:
    WTXHandler(const std::string& fp) : filepath(fp) {}

    void read() {
        std::ifstream file(filepath);
        if (!file.is_open()) {
            std::cout << "File " << filepath << " does not exist." << std::endl;
            return;
        }
        std::string line;
        while (std::getline(file, line)) {
            line.erase(std::remove_if(line.begin(), line.end(), ::isspace), line.end()); // Trim spaces (simple)
            size_t pos = line.find("=");
            if (pos != std::string::npos) {
                std::string key = line.substr(0, pos);
                std::string value = line.substr(pos + 1);
                properties[key] = value;
            }
        }
        file.close();
    }

    void decode() {
        // Plain text, decode is read
        read();
    }

    void printProperties() {
        if (properties.empty()) {
            std::cout << "No properties loaded." << std::endl;
            return;
        }
        for (const auto& pair : properties) {
            std::cout << pair.first << ": " << pair.second << std::endl;
        }
    }

    void write(const std::map<std::string, std::string>& newProperties) {
        std::ofstream file(filepath);
        if (!file.is_open()) {
            std::cout << "Could not open file for writing." << std::endl;
            return;
        }
        for (const auto& pair : newProperties) {
            file << pair.first << " = " << pair.second << std::endl;
        }
        file.close();
        std::cout << "Properties written to " << filepath << std::endl;
    }
};

// Example usage:
// int main() {
//     WTXHandler handler("example.wtx");
//     handler.decode();
//     handler.printProperties();
//     std::map<std::string, std::string> newProps = {{"CPU Type", "Intel Pentium"}, {"CPU Speed", "100 MHz"}};
//     handler.write(newProps);
//     return 0;
// }