file::SeekToEnd

Description

Sets the file pointer value to the end of the file. This is the same as file::Seek(0, file::end).

Syntax

LONG SeekToEnd( )

Parameters

Return

The number of bytes of the whole file

Examples

EX1

void file_SeekToEnd_ex1()
{
        file ff("C:\\float.txt", file::modeCreate | file::modeWrite);
        vector<float> vf(5);
        for ( int ii = 0; ii < vf.GetSize(); ii++ )
                vf[ii] = ii*1.25;
        ff.WriteFloat(vf, sizeof(float), vf.GetSize());

        LONG lFileSize;
        lFileSize = ff.SeekToEnd(); // Go to the End of the file. IFileSize = 20
        ff.Close();
}

Remark

See Also

file::GetPosition, file::Seek, file::SeekToBegin

header to Include

origin.h