|
-
Mar 6th, 2001, 12:50 AM
#1
Thread Starter
Member
Is there any *simple* way of getting a file's size, even if it is already open? I'm using this
Code:
Open f$ For Binary As #2
Size(J) = LOF(2)
Close #2
But, I get "Error 55: File already open" when it comes across files that are in use. I've looked at the GetFileSize and GetFileSizeEx API calls, and examples of how to use them, and I really don't wanna go through that much work just to get the file's size. I've also looked at GetFileAttributes, but that doesn't look any simpler. Any ideas?
Now the world is gone I'm just one...
-
Mar 6th, 2001, 05:28 AM
#2
PowerPoster
Ths can be done without any API function call.
Code:
Open "C:\pats.mdb" For Binary As #1
MsgBox "(From Open File) File size is : " & LOF(1) & " bytes"
Close #1
MsgBox "(using FileLen function and file is closed) File size is : " & FileLen("C:\pats.mdb") & "bytes"
-
Mar 6th, 2001, 08:53 AM
#3
Thread Starter
Member
Now the world is gone I'm just one...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|