This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/fileleng.c

18 lines
345 B
C

#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <io.h>
void main()
{
int handle;
/* open a file for input */
handle = open( "file", O_RDONLY | O_TEXT );
if( handle != -1 ) {
printf( "Size of file is %ld bytes\n",
filelength( handle ) );
close( handle );
}
}