File.size() is a ulong

spir denis.spir at gmail.com
Sun Jan 9 07:45:16 PST 2011


On Sun, 09 Jan 2011 08:29:47 -0500
bearophile <bearophileHUGS at lycos.com> wrote:

> From a recent update in File I've seen that size() returns an ulong, given by seek():
> http://www.dsource.org/projects/phobos/browser/trunk/phobos/std/stdio.d?rev=2284#L585
> http://www.dsource.org/projects/phobos/browser/trunk/phobos/std/stdio.d?rev=2284#L1245
> 
> It uses fseek, that seems to return a signed value:
> http://www.cplusplus.com/reference/clibrary/cstdio/ftell/
> 
> Isn't it better and safer if those functions of File return a long instead of an ulong?

For any reason, I would rather expect sizediff_t (read: a cardinal).

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d-learn mailing list