By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,450 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

how i can check the size of a text file

P: 36
hi for every one

i want to check the size of a text file and execute some statement dependent on that size ,example :


Expand|Select|Wrap|Line Numbers
  1. if the size of (c:\xx.txt)=0 bytes then 
  2. msgbox "file is empty"
how i can convert last example to code

thank you .
May 7 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
i want to check the size of a text file and execute some statement dependent on that size ,example :
Expand|Select|Wrap|Line Numbers
  1. if the size of (c:\xx.txt)=0 bytes then msgbox "file is empty"
how i can convert last example to code
What version of VB are you using?

In VB6, you have a couple of options. The simple one is to use the FileLen() function. The more complex, but also more flexible and powerful, is to use the FileSystemObject object.
May 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.