Fixed upper bound check for data shard cli argument in example encoders and file permission issue. (#98)
parent
a9588190c0
commit
a373324398
|
@ -67,8 +67,8 @@ func main() {
|
|||
flag.Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
if *dataShards > 257 {
|
||||
fmt.Fprintf(os.Stderr, "Error: Too many data shards\n")
|
||||
if (*dataShards + *parShards) > 256 {
|
||||
fmt.Fprintf(os.Stderr, "Error: sum of data and parity shards cannot exceed 256\n")
|
||||
os.Exit(1)
|
||||
}
|
||||
fname := args[0]
|
||||
|
@ -99,7 +99,7 @@ func main() {
|
|||
outfn := fmt.Sprintf("%s.%d", file, i)
|
||||
|
||||
fmt.Println("Writing to", outfn)
|
||||
err = ioutil.WriteFile(filepath.Join(dir, outfn), shard, os.ModePerm)
|
||||
err = ioutil.WriteFile(filepath.Join(dir, outfn), shard, 0644)
|
||||
checkErr(err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,8 +68,8 @@ func main() {
|
|||
flag.Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
if *dataShards > 257 {
|
||||
fmt.Fprintf(os.Stderr, "Error: Too many data shards\n")
|
||||
if (*dataShards + *parShards) > 256 {
|
||||
fmt.Fprintf(os.Stderr, "Error: sum of data and parity shards cannot exceed 256\n")
|
||||
os.Exit(1)
|
||||
}
|
||||
fname := args[0]
|
||||
|
|
Loading…
Reference in New Issue