You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rewrite introduction and examples to reflect the new writer API
including AddFS, programmatic file creation, and all supported
inode types. Update features list and add limitations section.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+62-50Lines changed: 62 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@
5
5
6
6
# squashfs
7
7
8
-
This is a read-only implementation of squashfs initially meant to be use with [go-fuse](https://github.com/hanwen/go-fuse/).
8
+
A pure Go implementation of SquashFS, supporting both reading and writing of squashfs filesystem images.
9
9
10
-
Since then, golang added `io/fs` and fuse support was moved to a `fuse` tag, which means this module can be either used with go-fuse, or as a simple `io/fs`-compliant squashfs file reader.
10
+
The read path implements Go's `io/fs`interface and optionally supports FUSE via the `fuse`build tag. The write path can create squashfs images from an `fs.FS`or programmatically, with support for all file types (regular files, directories, symlinks, devices, fifos, sockets) and compression formats.
11
11
12
12
## Tags
13
13
@@ -59,7 +59,7 @@ LZMA, LZO and LZ4 are also defined by squashfs and can be enabled similarly.
59
59
60
60
# Example usage
61
61
62
-
## Basic file access
62
+
## Reading a squashfs image
63
63
64
64
```go
65
65
sqfs, err:= squashfs.Open("file.squashfs")
@@ -68,67 +68,71 @@ if err != nil {
68
68
}
69
69
defer sqfs.Close()
70
70
71
-
// sqfs can be used as a regular fs.FS
71
+
// sqfs implements fs.FS, fs.ReadDirFS, and fs.StatFS
* Full metadata support: permissions (including setuid/setgid/sticky), uid/gid, timestamps
150
+
* GZip compression by default, with ZSTD and XZ available via build tags
151
+
* Extensible compression through the `RegisterCompHandler` API
152
+
* Optional FUSE support via the `fuse` build tag
153
+
* Directory index support for fast lookups in large directories
154
+
* Writer output validated against the reference `unsquashfs` implementation
155
+
* CLI tool for exploring and extracting files from squashfs archives
149
156
150
157
# CLI Tool
151
158
@@ -185,6 +192,11 @@ To install with additional compression support:
185
192
go install -tags "xz zstd" github.com/KarpelesLab/squashfs/cmd/sqfs@latest
186
193
```
187
194
188
-
# Performance
195
+
# Limitations
196
+
197
+
The writer does not currently support:
189
198
190
-
As of November 2024, directory indexes are now used for efficient file lookup in large directories, significantly improving performance for random file access.
199
+
* Fragment tables (tail-end packing of small files)
0 commit comments