1. Get Open File Size

This function returns the size of an open file and restores the btye
position so the programmer doesn't have to worry about it.

Tested code:

include file.e

function file_size(integer fn)
   atom save_ptr,size
   save_ptr=where(fn)
   if seek(fn,-1)!=0 then
      --error handling goes here
   end if
   size=where(fn)
   if seek(fn,save_ptr)!=0 then
      --error handling goes here
   end if
   return size
end function

-- Mike Nelson

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu