X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/f08fcf34cacb98d46cd8ee85398994db26a80a56..8953292ef197b80c16d08b31830945fb7ac9ff8d:/apt-pkg/contrib/fileutl.h?ds=sidebyside diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 74e0d542f..041aa3309 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: fileutl.h,v 1.24 2001/03/03 22:36:20 tausq Exp $ +// $Id: fileutl.h,v 1.26 2001/05/07 05:06:52 jgg Exp $ /* ###################################################################### File Utilities @@ -27,6 +27,8 @@ #include +using std::string; + class FileFd { protected: @@ -40,7 +42,14 @@ class FileFd public: enum OpenMode {ReadOnly,WriteEmpty,WriteExists,WriteAny,WriteTemp}; - bool Read(void *To,unsigned long Size,bool AllowEof = false); + inline bool Read(void *To,unsigned long Size,bool AllowEof) + { + unsigned long Jnk; + if (AllowEof) + return Read(To,Size,&Jnk); + return Read(To,Size); + } + bool Read(void *To,unsigned long Size,unsigned long *Actual = 0); bool Write(const void *From,unsigned long Size); bool Seek(unsigned long To); bool Skip(unsigned long To); @@ -78,8 +87,8 @@ string SafeGetCWD(); void SetCloseExec(int Fd,bool Close); void SetNonBlock(int Fd,bool Block); bool WaitFd(int Fd,bool write = false,unsigned long timeout = 0); -int ExecFork(); -bool ExecWait(int Pid,const char *Name,bool Reap = false); +pid_t ExecFork(); +bool ExecWait(pid_t Pid,const char *Name,bool Reap = false); // File string manipulators string flNotDir(string File);