Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

Make money selling software. Check this out here

Hosted clickbank mall. Check this out here




   Misc

   Amazon

   Links

    


Size of a file
 

 

Description

This example displays the size of a given file

Code

#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <sys\stat.h>

int main()
{
int fp;

long file_size;

if ((fp = open("f:/cprojects/urls.txt", O_RDONLY)) == -1)
printf("Error opening the file \n");
else
{
file_size = filelength(file_handle);
printf("The file size in bytes is %ld\n", file_size);
close(fp);
}
return 0;
}

Information

tested using LCC Win 32

 

 
 

 

Download

filesize.txt


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
Simple metatag generator(PHP)
fade in script(Javascript)
Find out part of a date(ASP)
Octal, hex and decimal(C++)
read a line(ASP)
Currency convertor(PHP)
network client information(VBScript)
Blinking text(C)

    




Copyright © 2003 by programmershelp.co.uk