TechnoTone
Well-known member
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. Ive also tried to open the file using OpenRead and that still doesnt 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 doesnt occur. I just get nothing returned instead of a FileStream object. I would have thought an exception would be raised.
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 doesnt occur. I just get nothing returned instead of a FileStream object. I would have thought an exception would be raised.