1. getfileinfo File Size?
- Posted by robby1066 <robby1066 at hotmail.com> Jul 30, 2004
- 661 views
I've been searching all through the documentation and forums for an answer to this. Can someone point me in the direction of a straightforward way to get a non-open file's filesize? it seems like it should get returned with the getfileinfo function, but I can't seem to find any documenation on it? Thanks!
2. Re: getfileinfo File Size?
- Posted by Jonas Temple <jtemple at yhti.net> Jul 30, 2004
- 657 views
robby1066 wrote: > > > I've been searching all through the documentation and forums for an answer to > this. > > Can someone point me in the direction of a straightforward way to get a > non-open file's > filesize? it seems like it should get returned with the getfileinfo function, > but I > can't seem to find any documenation on it? > > Thanks! > Have you considered using the Euphoria dir() function? This returns a sequence for each directory entry returned and the size of a member of each entry's sequence. For example
sequence file_info
file_info = dir("C:
autoexec.bat") printf(1, "File size: %d", file_info[1][D_SIZE]) <\eucode>
HTH,
Jonas }}}
3. Re: getfileinfo File Size?
- Posted by "Juergen Luethje" <j.lue at gmx.de> Jul 30, 2004
- 663 views
robby1066 wrote: > I've been searching all through the documentation and forums for an > answer to this. Look here in the documentation: HTML/lib_c_d.htm#dir > Can someone point me in the direction of a straightforward way to get a > non-open file's filesize? it seems like it should get returned with the > getfileinfo function, but I can't seem to find any documenation on it? > > Thanks!
-- Demo include file.e object x sequence fileName fileName = "test.txt" x = dir(fileName) if atom(x) then printf(1, "File '%s' not found.", {fileName}) else printf(1, "Size of file '%s' is %d bytes.", {fileName, x[1][D_SIZE]}) end if
Regards, Juergen
4. Re: getfileinfo File Size?
- Posted by robby1066 <robby1066 at hotmail.com> Jul 30, 2004
- 620 views
Ah! That's exactly what I'm looking for... Thanks so much!