ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
Re: [boost] [filesystem] No support for properties?
by Rob Stewart other posts by this author
Aug 19 2002 6:25PM messages near this date
RE: [boost] [filesystem] No support for properties? | [boost] Re: Creating static libs with gcc toolset on Solaris
From: Beman Dawes <bdawes@[...].org> 
>  
>  At 08:06 PM 8/18/2002, Jeff Garland wrote:
>  
>   >Unfortunately, I really need access to the file size for the program I
>   >am working on. I take it that the plan is that these properties are not
>   >coming back into the library in the near term, or should I be thinking
>   >about hacking some sort of extension?
>  
>  The questions that come to mind are:
>  
>  *  What type should a size function return?  Trickier than it sounds since 
>  many operating systems support file sizes larger than can be represented by 
>  a long. uintmax_t sounds better, but are we promising more than can be 
>  delivered if uintmax_t is too small (probably 32-bits) to hold the 
>  platform's maximum file size?

Windows provides an API that returns a large integer type plus has an output
parameter for the overflow because there isn't a sufficiently large integer
available.  On Solaris 2.8, stat has a field of type off_t, which maps to long
or long long, depending upon whether the application is 64 bit aware.

I should think returning a std::pair<unsigned, unsigned> , or something like that
would provide adequate capacity for all platforms.  I don't think you want to
use a pair for some platforms and not for others, and I think that a pair is
needed for some, so I think you should always return a pair, even if the type in
the pair changes with platform.


-- 
Rob Stewart                           stewart@[...].com
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Jeff Garland
Beman Dawes
Jeff Garland
Beman Dawes
Rob Stewart

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved