1. Get Open file size
- Posted by Aku <aku at inbox.as> Nov 29, 2000
- 359 views
How can I get file size/file length of opened file in eu? In VB I can use LOF(fn). By using dir() I only get size when the file last closed.
2. Re: Get Open file size
- Posted by OtterDad <otter at FULL-MOON.COM> Nov 28, 2000
- 359 views
- Last edited Nov 29, 2000
--=====================_20412311==_.ALT as I'm coding an entire library for random access files, i think know this one. you can perform a seek command on the open file that will put the file pointer at the end of the file. then read the file pointer again and you have the current size. use code similar to this. -- UNtested code follows fn = open("data.fil","r") -- puts pointer at end of file tempatom = seek(fn,-1) -- error handling for tempatom goes here -- now get the current file pointer filesize = where(fn) At 08:28 AM 11/29/00 +0700, you wrote: >How can I get file size/file length of opened file in eu? >In VB I can use LOF(fn). By using dir() I only get size when the file >last closed. --=====================_20412311==_.ALT <html> <font size=3>as I'm coding an entire library for random access files, i think know this one. you can perform a seek command on the open file that will put the file pointer at the end of the file. then read the file pointer again and you have the current size. use code similar to this.<br> <br> -- UNtested code follows<br> fn = open("data.fil","r")<br> <br> -- puts pointer at end of file<br> tempatom = seek(fn,-1)<br> -- error handling for tempatom goes here<br> <br> -- now get the current file pointer<br> filesize = where(fn)<br> <br> <br> At 08:28 AM 11/29/00 +0700, you wrote:<br> <blockquote type=cite cite>How can I get file size/file length of opened file in eu?<br> In VB I can use LOF(fn). By using dir() I only get size when the file<br> last closed. </font></blockquote></html> --=====================_20412311==_.ALT--
3. Re: Get Open file size
- Posted by Aku <aku at inbox.as> Nov 29, 2000
- 369 views
Thanks very much for your help. ______________________________________________________________________ O> as I'm coding an entire library for random access files, i think know this one. you can perform a seek command on the open file that will put the file pointer at the end of the file. then read the O> file pointer again and you have the current size. use code similar to this. O> -- UNtested code follows O> fn = open("data.fil","r") O> -- puts pointer at end of file O> tempatom = seek(fn,-1) O> -- error handling for tempatom goes here O> -- now get the current file pointer O> filesize = where(fn) O> At 08:28 AM 11/29/00 +0700, you wrote: >>How can I get file size/file length of opened file in eu? >>In VB I can use LOF(fn). By using dir() I only get size when the file >>last closed.