Update copyright year

This commit is contained in:
Terence Boldt 2023-01-03 16:39:07 -05:00
parent 299ce37ba4
commit 4e2be7dbb5
18 changed files with 63 additions and 40 deletions

View File

@ -8,11 +8,10 @@ Being a work in progress, be warned that this code is likely to corrupt drive im
There are binaries [here](https://github.com/tjboldt/ProDOS-Utilities/releases/latest) There are binaries [here](https://github.com/tjboldt/ProDOS-Utilities/releases/latest)
## Current TODO list ## Current TODO list
1. Allow > 128 KB file support 1. Create/Delete directories
2. Create/Delete directories 2. Add file/directory tests
3. Add file/directory tests 3. Add rename
4. Add rename 4. Add in-place file/directory moves
5. Add in-place file/directory moves
## Example commands and output ## Example commands and output

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
@ -17,7 +17,7 @@ import (
"github.com/tjboldt/ProDOS-Utilities/prodos" "github.com/tjboldt/ProDOS-Utilities/prodos"
) )
const version = "0.4.1" const version = "0.4.2"
func main() { func main() {
var fileName string var fileName string

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.

View File

@ -1,3 +1,9 @@
// Copyright Terence J. Boldt (c)2022-2023
// Use of this source code is governed by an MIT
// license that can be found in the LICENSE file.
// This file provides tests for conversion between BASIC and text
package prodos package prodos
import ( import (

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.

View File

@ -1,3 +1,10 @@
// Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT
// license that can be found in the LICENSE file.
// This file provides tests for access to volum bitmap on
// a ProDOS drive image
package prodos package prodos
import ( import (

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
@ -257,23 +257,21 @@ func getBlocklist(reader io.ReaderAt, fileEntry FileEntry, dataOnly bool) ([]int
return blocks, nil return blocks, nil
case StorageTree: case StorageTree:
dataBlocks := make([]int, fileEntry.BlocksUsed) dataBlocks := make([]int, fileEntry.BlocksUsed)
indexBlocks := make([]int, fileEntry.BlocksUsed/256+1)
masterIndex, err := ReadBlock(reader, fileEntry.KeyPointer) masterIndex, err := ReadBlock(reader, fileEntry.KeyPointer)
if err != nil { if err != nil {
return nil, err return nil, err
} }
blockOffset := 0 indexBlocks[0] = fileEntry.KeyPointer
if !dataOnly { indexBlockCount := 1
blocks[0] = fileEntry.KeyPointer
blockOffset = 1
}
for i := 0; i < 128; i++ { for i := 0; i < 128; i++ {
indexBlock := int(masterIndex[i]) + int(masterIndex[i+256])*256 indexBlock := int(masterIndex[i]) + int(masterIndex[i+256])*256
if indexBlock == 0 { if indexBlock == 0 {
break break
} }
if !dataOnly { indexBlocks[indexBlockCount] = indexBlock
blockOffset++ indexBlockCount++
}
index, err := ReadBlock(reader, indexBlock) index, err := ReadBlock(reader, indexBlock)
if err != nil { if err != nil {
return nil, err return nil, err
@ -290,7 +288,7 @@ func getBlocklist(reader io.ReaderAt, fileEntry FileEntry, dataOnly bool) ([]int
return dataBlocks, nil return dataBlocks, nil
} }
blocks = append(blocks[blockOffset:], dataBlocks...) blocks = append(indexBlocks, dataBlocks...)
return blocks, nil return blocks, nil
} }

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.

View File

@ -1,3 +1,9 @@
// Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT
// license that can be found in the LICENSE file.
// This file provides tests for access to format a ProDOS drive image
package prodos package prodos
import ( import (

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2022 // Copyright Terence J. Boldt (c)2022-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
@ -30,7 +30,7 @@ func AddFilesFromHostDirectory(
return err return err
} }
if !file.IsDir() && info.Size() > 0 && info.Size() <= 0x20000 { if !file.IsDir() && info.Size() > 0 && info.Size() <= 0x1000000 {
err = WriteFileFromFile(readerWriter, "", 0, 0, filepath.Join(directory, file.Name())) err = WriteFileFromFile(readerWriter, "", 0, 0, filepath.Join(directory, file.Name()))
if err != nil { if err != nil {
return err return err

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
@ -11,19 +11,20 @@ import (
) )
// DateTimeToProDOS converts Time to ProDOS date time // DateTimeToProDOS converts Time to ProDOS date time
// 49041 ($BF91) 49040 ($BF90)
// //
// 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 // 49041 ($BF91) 49040 ($BF90)
// +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
// DATE: | year | month | day |
// +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
// //
// 49043 ($BF93) 49042 ($BF92) // 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
// +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
// DATE: | year | month | day |
// +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
// //
// 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 // 49043 ($BF93) 49042 ($BF92)
// +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ //
// TIME: | hour | | minute | // 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
// +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ // +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
// TIME: | hour | | minute |
// +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
func DateTimeToProDOS(dateTime time.Time) []byte { func DateTimeToProDOS(dateTime time.Time) []byte {
year := dateTime.Year() % 100 year := dateTime.Year() % 100
month := dateTime.Month() month := dateTime.Month()

View File

@ -1,3 +1,9 @@
// Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT
// license that can be found in the LICENSE file.
// This file provides tests for conversion to and from ProDOS time format
package prodos package prodos
import ( import (

View File

@ -1,4 +1,4 @@
// Copyright Terence J. Boldt (c)2021-2022 // Copyright Terence J. Boldt (c)2021-2023
// Use of this source code is governed by an MIT // Use of this source code is governed by an MIT
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
@ -14,7 +14,7 @@ func printReadme() {
fmt.Println(` fmt.Println(`
MIT License MIT License
Copyright (c)2021-2022 Terence Boldt Copyright (c)2021-2023 Terence Boldt
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal