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 Jeff Garland other posts by this author
Aug 21 2002 12:08AM messages near this date
Re: [boost] [filesystem] No support for properties? | RE: [boost] [filesystem] No support for properties?
>   >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?

It seems that this is a perfect example of why the standard needs
to be extended to include a 64 bit type (the date-time library
is another example where a 64 bit time is extremely handy for 
creating an efficient implementation).  Since many C++ compilers
support this extension it seems like we could use boost::int64_t 
and then perhaps some simulated 64 bit type using a pair of 
int32_t for the platforms that don't support it.  But this seems 
like an awful lot of work for this...
 
>  *  Can a size function be reliably implemented on any operating system 
>  likely to be able to support the Filesystem Library? The answer is yes for 
>  most modern mainstream OS's, and yes for many small legacy OS's, at least 
>  if an allowable implementation is to open the file, seek to the end, get 
>  the position, close the file, and report the result.

Hmmm, the performance for the open, seek, close would really need to 
be documented.
 
>  *  What would be a good name?  (Remember from prior messages that if the 
>  function name is foo, and pth is a fs::path, we want foo( pth ) to be 
>  valid, but pth.foo() to be invalid.)  "file_size" is one obvious candidate.

How about size_in_bytes....

The thing you didn't answer in the last email was what the plan is for
the general support of properties (of which size would seem to be one).  
At one point there was a table of properties which Jan or someone was 
looking at implementing.  Is that just going into phase 2 or something? 
My worry is that if you implement size, next week I'll be asking you 
for modified date or something else.

Jeff
_______________________________________________
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