[erlang-questions] size of an open file

Bengt Kleberg bengt.kleberg@REDACTED
Wed May 14 09:44:18 CEST 2008


Greetings,

You have 2 possibilities according to the manual of the file module:
1) file:position/2 should return the file size, if called with 'eof' as
Position
2) if this is for debugging you can use file:pid2name/1 and get the file
name (for subsequent use in file:read_file_info/1).


bengt

On Wed, 2008-05-14 at 11:49 +1000, jm wrote:
> How do I get the size of an open file? file:read_file_info(Filename) 
> does it based on the name of the file but what about using an IoDevice 
> as returned by file:open/2.
> 
> Jeff.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list