[Mono-devel-list] Mono.Posix Structuring
tauberer at for.net
Fri Sep 24 07:42:01 EDT 2004
Jonathan Pryor wrote:
> Earlier (on IRC) I had brought up the "problem" of supporting the 64-bit
> Extended APIs. For example, there's stat(2) and stat64(). The extended
> APIs are primarily useful for 32-bit platforms that support files larger
> than 2^31 bytes.
I agree with what you said. #ifdef the c wrappers, create a new
I'd strongly suggest we .NET-ify the new wrappers, though. The methods
should be cased like other class library methods, and instead of
returning error codes they should throw meaningful exceptions. Then the
return values can be used for something more helpful (like readlink
returning the contents of the link, rather than putting it in an out
parameter.) I think it gives the library a best-of-both-worlds feel.
On the other hand, throwing an exception is probably too costly for some
methods, like stat, where you can reasonably expect an error return
value to occur often.
Is it worth having most of the methods throw exceptions, with a few
quirky ones that don't?
- Joshua Tauberer
** Nothing Unreal Exists **
More information about the Mono-devel-list