Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update xrootd #6399

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions X/xrootdgo/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using BinaryBuilder

name = "xrootdgo"
version = v"0.31.1"
version = v"0.32.1"

sources = [
GitSource("https://github.com/go-hep/hep/",
"c31af820c54f9d88ecdf40fe46a8bcf3a59f6f25"),
"18cd86eeb7ce2e816e349c2e53ddda93feb98948"),
DirectorySource("./bundled")
]

Expand Down
18 changes: 10 additions & 8 deletions X/xrootdgo/bundled/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import "C"
import (
"github.com/google/uuid"
"unsafe"
// "fmt"
"fmt"
"context"
"log"
// "log"
"go-hep.org/x/hep/xrootd"
"go-hep.org/x/hep/xrootd/xrdfs"
)
Expand All @@ -22,10 +22,12 @@ func Open(_baseurl *C.char, _filepath *C.char, _username *C.char) *C.char {
ctx := context.Background()
client, _ := xrootd.NewClient(ctx, baseurl, username)
file, err := client.FS().Open(ctx, filepath, xrdfs.OpenModeOwnerRead, xrdfs.OpenOptionsOpenRead)
_id := C.CString(uuid.NewString())
if err != nil {
log.Fatal(err)
fmt.Println(err)
_id = C.CString("error")
return _id
}
_id := C.CString(uuid.NewString())
_FILES[_id] = file
return _id
}
Expand All @@ -36,10 +38,10 @@ func Close(_id *C.char){
file, found := _FILES[_id]

if !found {
log.Fatal("can't find id to close")
fmt.Println("can't find id to close")
}
if err := file.Close(ctx); err != nil {
log.Fatal(err)
fmt.Println(err)
}
}

Expand All @@ -50,7 +52,7 @@ func Size(_id *C.char) C.long {
info, err := file.Stat(ctx)

if err != nil {
log.Fatal(err)
fmt.Println(err)
}
return C.long(info.EntrySize)
}
Expand All @@ -62,7 +64,7 @@ func ReadAt(res unsafe.Pointer, _id *C.char, NBytes C.long, offset C.long) {
// data := (*(*[2147483647]byte)(res))[:NBytes]
_, err := file.ReadAt(data, int64(offset))
if err != nil {
log.Fatal(err)
fmt.Println(err)
}
}

Expand Down