Added fragment calculations (untested).

This commit is contained in:
Caleb Gardner
2021-02-25 03:17:20 -06:00
parent ae5ade0683
commit c9d451e24c
5 changed files with 75 additions and 25 deletions
+3 -1
View File
@@ -24,6 +24,8 @@ func (w *Writer) fixFolders() error {
//WriteTo attempts to write the archive to the given io.Writer.
//Folder that aren't present (such as if you add a file at /folder/file, but not the folder /folder)
//are added with full permission (777).
//
//Not working. Yet.
func (w *Writer) WriteTo(write io.Writer) (int64, error) {
err := w.fixFolders()
if err != nil {
@@ -37,6 +39,7 @@ func (w *Writer) WriteTo(write io.Writer) (int64, error) {
w.Flags.RemoveDuplicates = false
w.Flags.Exportable = false
w.Flags.NoXattr = true
w.calculateFragsAndBlockSizes()
w.superblock = superblock{
Magic: magic,
InodeCount: w.countInodes(),
@@ -49,6 +52,5 @@ func (w *Writer) WriteTo(write io.Writer) (int64, error) {
MajorVersion: 4,
MinorVersion: 0,
}
_ = super
return 0, errors.New("I SAID DON'T")
}