Untested File Size Function

new topic     » topic index » view thread      » older message » newer message

I've heard a demand for a function (I assume one wants a function) that
returns the size of a file.  Well, this is my first function, and since i=
ts
late, it will go untested.

include file.e
global function file_size(sequence path)
    integer file_i, seek_success
    file_i =3D open(path, "rb)
    seek_success =3D seek(file_i, -1)
    return where(file_i)
    close file_i
end function

I am convinced that for simple things like this, that one should define
one's own function rather than try to get all of Euphoria changed.  That =
is
what user-defined functions are for.  (At the same token, however, it
possibly wouldn't be hard for Bob to put this into the Euphoria standard
release.)

--Alan
  =

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu