utils.Fatalf("invalid arguments, please specify both <chunkdb> (path to a local chunk database) and <file> (path to write the tar archive to, - for stdout)")
}
store,err:=openDbStore(args[0])
iferr!=nil{
utils.Fatalf("error opening local chunk database: %s",err)
}
deferstore.Close()
varoutio.Writer
ifargs[1]=="-"{
out=os.Stdout
}else{
f,err:=os.Create(args[1])
iferr!=nil{
utils.Fatalf("error opening output file: %s",err)
}
deferf.Close()
out=f
}
count,err:=store.Export(out)
iferr!=nil{
utils.Fatalf("error exporting local chunk database: %s",err)
utils.Fatalf("invalid arguments, please specify both <chunkdb> (path to a local chunk database) and <file> (path to read the tar archive from, - for stdin)")
}
store,err:=openDbStore(args[0])
iferr!=nil{
utils.Fatalf("error opening local chunk database: %s",err)
}
deferstore.Close()
varinio.Reader
ifargs[1]=="-"{
in=os.Stdin
}else{
f,err:=os.Open(args[1])
iferr!=nil{
utils.Fatalf("error opening input file: %s",err)
}
deferf.Close()
in=f
}
count,err:=store.Import(in)
iferr!=nil{
utils.Fatalf("error importing local chunk database: %s",err)