Logo Search packages:      
Sourcecode: akode version File versions  Download package

bool aKode::LocalFile::openRO (  )  [virtual]

Opens the file as read-only. Returns whether the operation was succesfull.

Reimplemented from aKode::File.

Definition at line 54 of file localfile.cpp.

References aKode::File::filename, and seek().

                       {
    if(_fd != -1) {
        return seek(0) && m_readable;
    }

    struct stat stat;
    _fd = ::open(filename, O_RDONLY);
    if (fstat(_fd, &stat) < 0) return false;
    len = stat.st_size;

    m_readable = true;
    m_writeable = false;
    m_eof = false;
    return ( _fd != -1 );
}


Generated by  Doxygen 1.6.0   Back to index