Documentation ¶
Overview ¶
Package recursivefs provides an io/fs implementation that can open paths in nested file systems recursively. The forensicfs are identified using the filetype library. This way e.g. a file in a zip inside a disk image can be accessed.
Example ¶
package main import ( "fmt" "io" "log" "os" "path" "github.com/forensicanalysis/fslib" "github.com/forensicanalysis/recursivefs" ) func main() { // Read the pdf header from a zip file on an NTFS disk image. // parse the file system fsys := recursivefs.New() // create fslib path wd, _ := os.Getwd() nestedPath := "testdata/data/filesystem/ntfs.dd/document/Computer forensics - Wikipedia.pdf" fpath, _ := fslib.ToFSPath(path.Join(wd, nestedPath)) file, err := fsys.Open(fpath) if err != nil { log.Fatal(err) } // get content content, _ := io.ReadAll(file) // print content fmt.Println(string(content[0:4])) // Outputx: %PDF }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS implements a read-only meta file system that can access nested file system structures.
type Info ¶
type Info struct {
// contains filtered or unexported fields
}
Info wraps the fs.FileInfo.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
fs
Package fs implements the fs command line tool that has various subcommands which imitate unix commands but for nested file system structures.
|
Package fs implements the fs command line tool that has various subcommands which imitate unix commands but for nested file system structures. |
Click to show internal directories.
Click to hide internal directories.