ROOT » NET » NET » TFTP

class TFTP: public TObject


TFTP

This class provides all infrastructure for a performant file
transfer protocol. It works in conjuction with the rootd daemon
and can use parallel sockets to improve performance over fat pipes.


Function Members (Methods)

public:
virtual~TFTP()
voidTObject::AbstractMethod(const char* method) const
Bool_tAccessPathName(const char* path, EAccessMode mode = kFileExists, Bool_t print = kFALSE)
virtual voidTObject::AppendPad(Option_t* option = "")
voidAscii()
voidascii()
voidbin()
voidBinary()
virtual voidTObject::Browse(TBrowser* b)
voidbye()
voidcd(const char* dir) const
Int_tChangeDirectory(const char* dir) const
Int_tChangePermission(const char* file, Int_t mode) const
voidchmod(const char* file, Int_t mode) const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
Int_tClose()
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
Int_tDeleteDirectory(const char* dir) const
Int_tDeleteFile(const char* file) const
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
voidFreeDirectory(Bool_t print = kFALSE)
voidget(const char* file, const char* localName = 0)
Int_tGetBlockSize() const
const char*GetDirEntry(Bool_t print = kFALSE)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Long64_tGetFile(const char* file, const char* localName = 0)
virtual const char*TObject::GetIconName() const
Int_tGetMode() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Int_tGetPathInfo(const char* path, FileStat_t& buf, Bool_t print = kFALSE)
Long64_tGetRestartAt() const
TSocket*GetSocket() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
Bool_tIsOpen() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
Int_tListDirectory(Option_t* cmd = "") const
virtual voidls(Option_t* cmd = "") const
Int_tMakeDirectory(const char* dir, Bool_t print = kFALSE) const
voidTObject::MayNotUse(const char* method) const
voidmkdir(const char* dir) const
voidmv(const char* file1, const char* file2) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
Bool_tOpenDirectory(const char* name, Bool_t print = kFALSE)
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* opt = "") const
Int_tPrintDirectory() const
voidput(const char* file, const char* remoteName = 0)
Long64_tPutFile(const char* file, const char* remoteName = 0)
voidpwd() const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
Int_tRenameFile(const char* file1, const char* file2) const
voidTObject::ResetBit(UInt_t f)
voidrm(const char* file) const
voidrmdir(const char* dir) const
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetBlockSize(Int_t blockSize)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetRestartAt(Long64_t at)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TFTP(const char* url, Int_t parallel = 1, Int_t wsize = kDfltWindowSize, TSocket* sock = 0)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
voidInit(const char* url, Int_t parallel, Int_t wsize)
voidoperator=(const TFTP&)
voidPrintError(const char* where, Int_t err) const
Int_tRecv(Int_t& status, EMessageTypes& kind) const
voidSetMode(Int_t mode)
TFTP()
TFTP(const TFTP&)

Data Members

public:
static TFTP::(anonymous)kAscii
static TFTP::(anonymous)kBinary
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TFTP::(anonymous)kDfltBlockSize
static TFTP::(anonymous)kDfltWindowSize
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
private:
Int_tfBlockSizesize of data buffer used to transfer
Long64_tfBytesReadnumber of bytes received
Long64_tfBytesWritenumber of bytes sent
TStringfCurrentFilefile currently being get or put
Bool_tfDirIndicates if a remote directory is open
TStringfHostFQDN of remote host
Int_tfLastBlocklast block successfully transfered
Int_tfModebinary or ascii file transfer mode
Int_tfParallelnumber of parallel sockets
Int_tfPortport to which to connect
Int_tfProtocolrootd protocol level
Long64_tfRestartAtrestart transmission at specified offset
TSocket*fSocket! connection to rootd
TStringfUserremote user
Int_tfWindowSizetcp window size used
static Long64_tfgBytesReadnumber of bytes received by all TFTP objects
static Long64_tfgBytesWritenumber of bytes sent by all TFTP objects

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TFTP(const char* url, Int_t parallel = 1, Int_t wsize = kDfltWindowSize, TSocket* sock = 0)
 Open connection to host specified by the url using par parallel sockets.
 The url has the form: [root[s,k]://]host[:port].
 If port is not specified the default rootd port (1094) will be used.
 Using wsize one can specify the tcp window size. Normally this is not
 needed when using parallel sockets.
 An existing connection (TSocket *sock) can also be used to establish
 the FTP session.
void Init(const char* url, Int_t parallel, Int_t wsize)
 Set up the actual connection.
~TFTP()
 TFTP dtor. Send close message and close socket.
void Print(Option_t* opt = "") const
 Print some info about the FTP connection.
void PrintError(const char* where, Int_t err) const
 Print error string depending on error code.
Int_t Recv(Int_t& status, EMessageTypes& kind) const
 Return status from rootd server and message kind. Returns -1 in
 case of error otherwise 8 (sizeof 2 words, status and kind).
void SetBlockSize(Int_t blockSize)
 Make sure the block size is a power of two, with a minimum of 32768.
Long64_t PutFile(const char* file, const char* remoteName = 0)
 Transfer file to remote host. Returns number of bytes
 sent or < 0 in case of error. Error -1 connection is still
 open, error -2 connection has been closed. In case of failure
 fRestartAt is set to the number of bytes correclty transfered.
 Calling PutFile() immediately afterwards will restart at fRestartAt.
 If this is not desired call SetRestartAt(0) before calling PutFile().
 If rootd reports that the file is locked, and you are sure this is not
 the case (e.g. due to a crash), you can force unlock it by prepending
 the remoteName with a '-'.
Long64_t GetFile(const char* file, const char* localName = 0)
 Transfer file from remote host. Returns number of bytes
 received or < 0 in case of error. Error -1 connection is still
 open, error -2 connection has been closed. In case of failure
 fRestartAt is set to the number of bytes correclty transfered.
 Calling GetFile() immediately afterwards will restart at fRestartAt.
 If this is not desired call SetRestartAt(0) before calling GetFile().
 If rootd reports that the file is locked, and you are sure this is not
 the case (e.g. due to a crash), you can force unlock it by prepending
 the file name with a '-'.
Int_t ChangeDirectory(const char* dir) const
 Change the remote directory. If the remote directory contains a .message
 file and it is < 1024 characters then the contents is echoed back.
 Returns 0 in case of success and -1 in case of failure.
Int_t MakeDirectory(const char* dir, Bool_t print = kFALSE) const
 Make a remote directory. Anonymous users may not create directories.
 Returns 0 in case of success and -1 in case of failure.
Int_t DeleteDirectory(const char* dir) const
 Delete a remote directory. Anonymous users may not delete directories.
 Returns 0 in case of success and -1 in case of failure.
Int_t ListDirectory(Option_t* cmd = "") const
 List remote directory. With cmd you specify the options and directory
 to be listed to ls. Returns 0 in case of success and -1 in case of
 failure.
Int_t PrintDirectory() const
 Print path of remote working directory. Returns 0 in case of succes and
 -1 in cse of failure.
Int_t RenameFile(const char* file1, const char* file2) const
 Rename a remote file. Anonymous users may not rename files.
 Returns 0 in case of success and -1 in case of failure.
Int_t DeleteFile(const char* file) const
 Delete a remote file. Anonymous users may not delete files.
 Returns 0 in case of success and -1 in case of failure.
Int_t ChangePermission(const char* file, Int_t mode) const
 Change permissions of a remote file. Anonymous users may not
 chnage permissions. Returns 0 in case of success and -1 in case
 of failure.
Int_t Close()
 Close ftp connection. Returns 0 in case of success and -1 in case of
 failure.
Bool_t OpenDirectory(const char* name, Bool_t print = kFALSE)
 Open a directory via rootd.
 Returns kTRUE in case of success.
 Returns kFALSE in case of error.
void FreeDirectory(Bool_t print = kFALSE)
 Free a remotely open directory via rootd.
const char * GetDirEntry(Bool_t print = kFALSE)
 Get directory entry via rootd.
 Returns 0 in case no more entries or in case of error.
Int_t GetPathInfo(const char* path, FileStat_t& buf, Bool_t print = kFALSE)
 Get info about a file. Info is returned in the form of a FileStat_t
 structure (see TSystem.h).
 The function returns 0 in case of success and 1 if the file could
 not be stat'ed.
Bool_t AccessPathName(const char* path, EAccessMode mode = kFileExists, Bool_t print = kFALSE)
 Returns kFALSE if one can access a file using the specified access mode.
 Mode is the same as for the Unix access(2) function.
 Attention, bizarre convention of return value!!
TFTP()
{ }
TFTP(const TFTP& )
void operator=(const TFTP& )
void SetMode(Int_t mode)
{ fMode = mode; }
Int_t GetBlockSize() const
{ return fBlockSize; }
void SetRestartAt(Long64_t at)
{ fRestartAt = at; }
Long64_t GetRestartAt() const
{ return fRestartAt; }
Int_t GetMode() const
{ return fMode; }
Bool_t IsOpen() const
{ return fSocket ? kTRUE : kFALSE; }
void Binary()
void Ascii()
TSocket * GetSocket() const
{ return fSocket; }
void put(const char* file, const char* remoteName = 0)
 standard ftp equivalents...
{ PutFile(file, remoteName); }
void get(const char* file, const char* localName = 0)
{ GetFile(file, localName); }
void cd(const char* dir) const
{ ChangeDirectory(dir); }
void mkdir(const char* dir) const
{ MakeDirectory(dir); }
void rmdir(const char* dir) const
{ DeleteDirectory(dir); }
void ls(Option_t* cmd = "") const
{ ListDirectory(cmd); }
void pwd() const
void mv(const char* file1, const char* file2) const
{ RenameFile(file1, file2); }
void rm(const char* file) const
{ DeleteFile(file); }
void chmod(const char* file, Int_t mode) const
{ ChangePermission(file, mode); }
void bye()
{ Close(); }
void bin()
{ Binary(); }
void ascii()
{ Ascii(); }