-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
578 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package bz2 | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
// // | ||
// Copyright (c) 2023 ESSENTIAL KAOS // | ||
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> // | ||
// // | ||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
func ExampleUnpack() { | ||
file := "file.bz2" | ||
err := Unpack(file, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} | ||
|
||
func ExampleRead() { | ||
file := "file.bz2" | ||
fd, err := os.OpenFile(file, os.O_RDONLY, 0) | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
err = Read(fd, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package npck | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
// // | ||
// Copyright (c) 2023 ESSENTIAL KAOS // | ||
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> // | ||
// // | ||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
func ExampleUnpack() { | ||
file := "file.tzg" | ||
err := Unpack(file, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package gz | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
// // | ||
// Copyright (c) 2023 ESSENTIAL KAOS // | ||
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> // | ||
// // | ||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
func ExampleUnpack() { | ||
file := "file.gz" | ||
err := Unpack(file, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} | ||
|
||
func ExampleRead() { | ||
file := "file.gz" | ||
fd, err := os.OpenFile(file, os.O_RDONLY, 0) | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
err = Read(fd, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package lz4 | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
// // | ||
// Copyright (c) 2023 ESSENTIAL KAOS // | ||
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> // | ||
// // | ||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
func ExampleUnpack() { | ||
file := "file.lz4" | ||
err := Unpack(file, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} | ||
|
||
func ExampleRead() { | ||
file := "file.lz4" | ||
fd, err := os.OpenFile(file, os.O_RDONLY, 0) | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
err = Read(fd, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package tar | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
// // | ||
// Copyright (c) 2023 ESSENTIAL KAOS // | ||
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> // | ||
// // | ||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
func ExampleUnpack() { | ||
file := "file.tar" | ||
err := Unpack(file, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} | ||
|
||
func ExampleRead() { | ||
file := "file.tar" | ||
fd, err := os.OpenFile(file, os.O_RDONLY, 0) | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
err = Read(fd, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package tbz2 | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
// // | ||
// Copyright (c) 2023 ESSENTIAL KAOS // | ||
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> // | ||
// // | ||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
func ExampleUnpack() { | ||
file := "file.tbz2" | ||
err := Unpack(file, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} | ||
|
||
func ExampleRead() { | ||
file := "file.tbz2" | ||
fd, err := os.OpenFile(file, os.O_RDONLY, 0) | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
err = Read(fd, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package tgz | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
// // | ||
// Copyright (c) 2023 ESSENTIAL KAOS // | ||
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> // | ||
// // | ||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
func ExampleUnpack() { | ||
file := "file.tgz" | ||
err := Unpack(file, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} | ||
|
||
func ExampleRead() { | ||
file := "file.tgz" | ||
fd, err := os.OpenFile(file, os.O_RDONLY, 0) | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
err = Read(fd, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package tlz4 | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
// // | ||
// Copyright (c) 2023 ESSENTIAL KAOS // | ||
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> // | ||
// // | ||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// ////////////////////////////////////////////////////////////////////////////////// // | ||
|
||
func ExampleUnpack() { | ||
file := "file.tlz4" | ||
err := Unpack(file, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} | ||
|
||
func ExampleRead() { | ||
file := "file.tlz4" | ||
fd, err := os.OpenFile(file, os.O_RDONLY, 0) | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
err = Read(fd, "/home/bob/data") | ||
|
||
if err != nil { | ||
fmt.Printf("Error: Can't unpack %s: %v\n", file, err) | ||
return | ||
} | ||
|
||
fmt.Printf("File %s successfully unpacked!\n", file) | ||
} |
Oops, something went wrong.