hep: go-hep.org/x/hep/xrootd/xrdio Index | Files

package xrdio

import "go-hep.org/x/hep/xrootd/xrdio"

Package xrdio provides a File type that implements various interfaces from the io package.


Package Files

parse.go xrdio.go

type File Uses

type File struct {
    // contains filtered or unexported fields

File wraps a xrdfs.File and implements the following interfaces:

- io.Closer
- io.Reader
- io.Writer
- io.ReaderAt
- io.WriterAt
- io.Seeker

func Open Uses

func Open(name string) (*File, error)

Open opens the name file, where name is the absolute location of that file (xrootd server address and path to the file on that server.)


f, err := xrdio.Open("root://server.example.com:1094//some/path/to/file")

func OpenFrom Uses

func OpenFrom(fs xrdfs.FileSystem, name string) (*File, error)

OpenFrom opens the file name via the given filesystem handle. name is the absolute path of the wanted file on the server.


f, err := xrdio.OpenFrom(fs, "/some/path/to/file")

func (*File) Close Uses

func (f *File) Close() error

Close implements io.Closer.

func (*File) Name Uses

func (f *File) Name() string

Name returns the name of the file.

func (*File) Read Uses

func (f *File) Read(data []byte) (int, error)

Read implements io.Reader.

func (*File) ReadAt Uses

func (f *File) ReadAt(data []byte, offset int64) (int, error)

ReadAt implements io.ReaderAt.

func (*File) Seek Uses

func (f *File) Seek(offset int64, whence int) (int64, error)

Seek implements io.Seeker

func (*File) Stat Uses

func (f *File) Stat() (os.FileInfo, error)

func (*File) Write Uses

func (f *File) Write(data []byte) (int, error)

Write implements io.Writer.

func (*File) WriteAt Uses

func (f *File) WriteAt(data []byte, offset int64) (int, error)

WriteAt implements io.WriterAt.

type URL Uses

type URL struct {
    Addr string // address (host [:port]) of the server
    User string // user name to use to log in
    Path string // path to the remote file or directory

URL stores an absolute reference to a XRootD path.

func Parse Uses

func Parse(name string) (URL, error)

Parse parses name into an xrootd URL structure.

Package xrdio imports 8 packages (graph) and is imported by 5 packages. Updated 2019-02-21. Refresh now. Tools for package owners.