Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am trying to get the size of a file. I am using the Open method of the File class to get a FileStream object and using the Length property which is working fine when the file is accessible. However, most of the time the file will be open by another program. I've also tried to open the file using OpenRead and that still doesn't work.

 

How can I get the size of a file without actually opening it?

 

 

PS. The strange thing is that when I attempt to open a file that is in use by another pogram an exception doesn't occur. I just get nothing returned instead of a FileStream object. I would have thought an exception would be raised.

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Posted

I figured it was something simple - I just couldn't find it in the help.

 

Thanks.

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...