mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
logic in place for handling multiple files
- hash file with info and check hash - make explicit request for chunks - check file directly for empty chunks, request them - skip files if they already exist on machine
This commit is contained in:
parent
f74816c7c7
commit
311c144ebd
2 changed files with 207 additions and 86 deletions
18
main.go
18
main.go
|
@ -7,6 +7,22 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
// f, _ := os.Create("test.1")
|
||||
// f.Truncate(8096)
|
||||
// f.Close()
|
||||
|
||||
// file, _ := os.Open("test.1")
|
||||
// defer file.Close()
|
||||
|
||||
// buffer := make([]byte, 4096)
|
||||
// emptyBuffer := make([]byte, 4096)
|
||||
// for {
|
||||
// bytesread, err := file.Read(buffer)
|
||||
// if err != nil {
|
||||
// break
|
||||
// }
|
||||
// fmt.Println(bytes.Equal(buffer[:bytesread], emptyBuffer[:bytesread]))
|
||||
// }
|
||||
var sender bool
|
||||
flag.BoolVar(&sender, "sender", false, "sender")
|
||||
flag.Parse()
|
||||
|
@ -18,7 +34,7 @@ func main() {
|
|||
err = c.Send(croc.TransferOptions{
|
||||
// PathToFile: "../wskeystore/README.md",
|
||||
// PathToFile: "./src/croc/croc.go",
|
||||
PathToFile: "C:\\Users\\zacks\\go\\src\\github.com\\schollz\\croc\\src\\croc\\croc.go",
|
||||
PathToFiles: []string{"C:\\Users\\zacks\\go\\src\\github.com\\schollz\\croc\\src\\croc\\croc.go", "croc.exe"},
|
||||
KeepPathInRemote: false,
|
||||
})
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue