diff options
author | Pixel <Pixel> | 2002-08-13 18:20:13 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2002-08-13 18:20:13 +0000 |
commit | 1d836e3fd9d3c4f9ce08b6a062dd597e5fe4e1dc (patch) | |
tree | 41cbf99c45ad771a4b9f1812f38cf396e738803e /generic/Input.cpp | |
parent | 89a43700b18c61d209ffb68db57e020f11a2daa9 (diff) |
Worked a little more
Diffstat (limited to 'generic/Input.cpp')
-rw-r--r-- | generic/Input.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/generic/Input.cpp b/generic/Input.cpp index 7106c8d..ffef9f0 100644 --- a/generic/Input.cpp +++ b/generic/Input.cpp @@ -41,6 +41,14 @@ bool Input::CanRead() { return 1; } +bool Input::CanSeek() { + struct stat s; + + fstat(GetHandle(), &s); + + return S_ISREG(s.st_mode); +} + String Input::GetName() { return n; } @@ -53,14 +61,18 @@ time_t Input::GetModif() { return date_modif; } -Stdin_t::Stdin_t() : Handle(dup(0)) { } - -bool Stdin_t::CanWrite() { - return 0; +off_t Input::seek(off_t offset, int whence) { + itell = lseek(GetHandle(), offset, whence); +#ifdef PARANOID_SEEK + if (itell != lseek(GetHandle(), 0, SEEK_CUR)) { + } +#endif } -bool Stdin_t::CanRead() { - return 1; +Stdin_t::Stdin_t() { } + +bool Stdin_t::CanSeek() { + return 0; } String Stdin_t::GetName() { |