Boost logo

Boost :

From: Fanta, Richard (Richard.Fanta_at_[hidden])
Date: 2003-06-30 09:00:46


[Previously posted on Boost::Users (to no response); perhaps this is better
forum??]

Hiya,

I've been attempting to try out the attributes code in the boost-sandbox,
but am running into some snags using VC++ version 7 (that comes with
VS .NYET).

One simple goal here would be to discern whether a file is writeable.
Can this be done with the filesystem::attributes library??

The code for attr_test.cpp from the tests directory is included below;
it's been slightly modified to run stand-alone instead of through the
boost test harness.

Problem #1: No string() method on the cache class.

Problem #2: The "<<" operator won't work.

For the latter, I've seen it suggested that typedefs might help, but
don't understand what the underlying issue is. Is this a lingering
Microsoft (i.e. VC++) specific issue? I'd greatly appreciate any
clarification that people can offer.

Much thanks,
Richard Fanta

----------------Errors----------------------------------------------
x:\v\ReviewAgent\AttrTest\attr_test.cpp(23) : error C2039: 'string' :
is not a member of 'boost::filesystem::cache'

x:\ReviewAgent\Util\boost_1_30_0_filesystem\boost\filesystem\cache.hpp(33)
: see declaration of 'boost::filesystem::cache'
x:\v\ReviewAgent\AttrTest\attr_test.cpp(25) : error C2676: binary '<<'
: 'boost::filesystem::cache' does not define this operator or a
conversion to a type acceptable to the predefined operator
x:\v\ReviewAgent\AttrTest\attr_test.cpp(26) : error C2676: binary '<<'
: 'boost::filesystem::cache' does not define this operator or a
conversion to a type acceptable to the predefined operator
x:\v\ReviewAgent\AttrTest\attr_test.cpp(26) : error C2676: binary '<<'
: 'boost::filesystem::cache' does not define this operator or a
conversion to a type acceptable to the predefined operator

----------------Source----------------------------------------------
#include <iostream>
#include <exception>
#include <string>

#include "boost/filesystem/attributes.hpp"
#include "boost/filesystem/path.hpp"
//#include "boost/test/minimal.hpp"

namespace fs = boost::filesystem;

//int test_main (int argc, char **argv)
int main (int argc, char **argv)
{
for (int i = 1; i < argc; ++i) {
fs::path file (argv [i], fs::native);
fs::cache pm (file);
std::cout //<< "name: " << get <fs::filename> (pm).string ()
<< "; size: " << get <fs::size> (pm)
<< "; owner: " << get <fs::owner> (pm)
<< "; group: " << get <fs::group> (pm) << "\n";
}

**** Important Notice to Recipients ****
It is important that you do not use e-mail to request, authorize or effect
the purchase or sale of any security or commodity, to send fund transfer
instructions, or to effect any other transactions. Any such request,
orders, or instructions that you send will not be accepted and will not be
processed by Morgan Stanley.
Check your account, get the latest news and research and learn more about
Morgan Stanley at www.morganstanley.com/individual.
****************************************


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk