A comprehensive Java library for reading and writing FAT (File Allocation Table) filesystems with full support for FAT12, FAT16, and FAT32 formats.
- π§ Complete FAT Support: Read/write operations on FAT12, FAT16, and FAT32
- π Long Filename Support: Full Unicode LFN support with automatic short name generation
- β‘ Intelligent Cluster Sizing: Microsoft-compliant cluster size optimization for peak performance
- π Fragmentation Analysis: Comprehensive filesystem health analysis with performance impact assessment
- π§ Defragmentation Intelligence: Smart recommendations for optimizing file allocation and free space
- π₯οΈ Command-Line Interface: Comprehensive CLI with filesystem operations and analysis
- π Web Interface: Modern browser-based interface with real-time visualization
- π Advanced Analysis: Expert-mode visualization with cluster chain mapping and FAT table analysis
- π» Interactive Shell: MS-DOS-like commands for intuitive filesystem navigation
- ποΈ Device Flexibility: Support for disk images, block devices, and custom storage backends
- π§ͺ Production Ready: Extensive test suite with performance benchmarks
Gradle:
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/jseitter/jfat")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
implementation 'net.seitter.jfat:jfat:0.1.0'
}Direct Download: Download the latest JAR from GitHub Releases
# Create a FAT32 filesystem with optimal cluster size
java -jar jfat.jar create disk.img fat32 1024 # 1GB with automatic 4KB clusters
# Explore filesystem contents
java -jar jfat.jar list disk.img
java -jar jfat.jar info disk.img # Shows cluster size optimization details
# Analyze filesystem fragmentation
java -jar jfat.jar fragmentation disk.img # Overall fragmentation summary
java -jar jfat.jar frag disk.img files # Detailed file fragmentation analysis
java -jar jfat.jar frag disk.img recommendations # Get defragmentation recommendations
# Interactive exploration
java -jar jfat.jar interactive disk.img
# Start web interface
java -jar jfat.jar webserver 8080 # Open http://localhost:8080Launch the modern browser-based interface for filesystem management:
# Start web server (production mode)
java -jar jfat.jar webserver 8080
# Start in development mode
java -jar jfat.jar web 3000 --devThe web interface provides:
- π Real-time Dashboard: Filesystem statistics and health monitoring
- π File Browser: Drag-and-drop file management with directory navigation
- π Graph Visualization: Interactive cluster allocation and fragmentation analysis
- βοΈ Image Manager: Create, delete, and analyze FAT images
- π¬ Expert Mode: Detailed FAT table visualization for digital forensics
import net.seitter.jfat.core.FatFileSystem;
import net.seitter.jfat.io.DeviceAccess;
import net.seitter.jfat.util.DiskImageCreator;
// Create an optimized FAT32 image
DiskImageCreator.createDiskImage("disk.img", FatType.FAT32, 1024); // Auto-selects 4KB clusters
// Mount and use the filesystem
try (DeviceAccess device = new DeviceAccess("disk.img");
FatFileSystem fs = FatFileSystem.mount(device)) {
// Work with long filenames and Unicode
FatFile file = fs.createFile("/My π Project Files/Π΄ΠΎΠΊΡΠΌΠ΅Π½Ρ.txt");
file.write("Hello, FAT filesystem!".getBytes());
// Analyze cluster configuration
System.out.println(fs.getBootSector().getClusterSizeInfo());
}JFAT automatically selects optimal cluster sizes following Microsoft specifications:
- FAT16: 1KB (β€16MB) β 2KB (β€128MB) β 4KB (β€256MB) β 8KB (β€512MB)
- FAT32: 4KB (β€8GB) β 8KB (β€16GB) β 16KB (β€32GB) β 32KB (>32GB)
- Custom Configuration: Support for custom sector sizes (512B-4KB) and cluster configurations
# View cluster size recommendations
java -jar jfat.jar info disk.img
# Output:
# Cluster Size: 4096 bytes (4 KB)
# Sectors per Cluster: 8
# Cluster size β€ 32MB: β YES
# Overall validation: β PASSED# Generate detailed filesystem visualization
java -jar jfat.jar graph disk.img analysis.dot --expert
dot -Tpng analysis.dot -o filesystem.pngExpert mode provides:
- FAT Table Summary: Cluster usage statistics and health metrics
- Cluster Chain Visualization: File fragmentation and allocation patterns
- Performance Analysis: Optimal cluster size recommendations
- Digital Forensics: Detailed cluster-level file storage mapping
Full Unicode support with automatic short name generation:
// Create files with long Unicode names
FatFile unicodeFile = root.createFile("ΠΠΎΠΊΡΠΌΠ΅Π½Ρ Ρ ΠΎΡΠ΅Π½Ρ Π΄Π»ΠΈΠ½Π½ΡΠΌ ΠΈΠΌΠ΅Π½Π΅ΠΌ ΡΠ°ΠΉΠ»Π°.txt");
FatFile emojiFile = root.createFile("My π Project File.doc");
// JFAT automatically generates 8.3 short names: ΠΠΠΠ£ΠΠ~1.TXT, MY~1.DOC- π CLI Reference: Complete command-line interface guide
- π Web Interface: Browser-based filesystem management
- π§ API Guide: Programmatic usage and integration examples
- π§ͺ Testing Guide: Test suite structure and custom testing
- π¨ Development Guide: Building from source and contributing
- π CI/CD Guide: Automated build and release processes
git clone https://github.com/jseitter/jfat.git
cd jfat
./gradlew build
# Run the CLI
java -jar build/libs/jfat-*.jar help# Run comprehensive test suite
./gradlew test
# Performance benchmarks
./gradlew test --tests "FatPerformanceTest"
# Test with your own FAT images
./gradlew runFatfsTest --args="path/to/your/image.img"- π¬ Digital Forensics: Analyze FAT filesystems with cluster-level detail
- βοΈ Embedded Systems: Create optimized filesystems for resource-constrained devices
- ποΈ Legacy Support: Read/write legacy FAT12 floppy disk images
- π¦ System Integration: Programmatic FAT filesystem manipulation in Java applications
- π Education: Learn FAT filesystem internals with visualization tools
src/main/java/net/seitter/jfat/
βββ core/ # Core FAT filesystem implementation
βββ io/ # Device access and I/O abstraction
βββ util/ # Cluster optimization and disk image creation
βββ cli/ # Command-line interface with enhanced analysis
βββ examples/ # Usage examples and standalone tools
docs/ # Comprehensive documentation
βββ cli-reference.md # Command-line guide
βββ api-guide.md # Programming interface
βββ testing.md # Test suite documentation
βββ development.md # Building and contributing
βββ ci-cd.md # Automated workflows
We welcome contributions! See the Development Guide for:
- Building from source
- Code style guidelines
- Testing requirements
- Pull request process
This project is licensed under the MIT License - see the LICENSE file for details.
JFAT implements the complete Microsoft FAT specification with modern Java best practices, providing both high-level convenience and low-level control for professional filesystem manipulation.