are there c++ classes that provide file, directory or file systemfunctionality?

D

darren

Hello

In a program i'm writing, I need to be able to serve files from a
specified directory. I don't want to reinvent the wheel by writing a
class that provides basic directory a file functionality if something
similar already exists. I'm looking for something similar to what;s
provided in java i guess. The ability to list files in a given
directory, support for ".." "." etc.

After googling around a bit, its apparent that this functionality is
not built into the language itself, and is fairly OS dependant. i'm
mainly interesting in targeting a unix environment. I've found
frameworks like Boost, which look pretty cool, but a specification for
this assignment, is that no libraries are allowed in the deliverable.
In other words, Boost is out, because the submission must only be
source code.

I would appreciate any advice on how you guys get such information
about a file system in your programs, or if you know of any helpful
resources. Thanks.
 
J

Juha Nieminen

darren said:
After googling around a bit, its apparent that this functionality is
not built into the language itself, and is fairly OS dependant. i'm
mainly interesting in targeting a unix environment. I've found
frameworks like Boost, which look pretty cool, but a specification for
this assignment, is that no libraries are allowed in the deliverable.
In other words, Boost is out, because the submission must only be
source code.

You have to create system-specific code, but you are not allowed to
use libraries? Isn't that kind of an impossible problem?
 
I

Ian Collins

Juha said:
You have to create system-specific code, but you are not allowed to
use libraries? Isn't that kind of an impossible problem?

Well boost.filesystem is header only, so if the rules are flexible, it
might be OK.
 
E

Erik Wikström

D

David Côme

Hello

In a program i'm writing, I need to be able to serve files from a
specified directory. I don't want to reinvent the wheel by writing a
class that provides basic directory a file functionality if something
similar already exists. I'm looking for something similar to what;s
provided in java i guess. The ability to list files in a given
directory, support for ".." "." etc.

After googling around a bit, its apparent that this functionality is
not built into the language itself, and is fairly OS dependant. i'm
mainly interesting in targeting a unix environment. I've found
frameworks like Boost, which look pretty cool, but a specification for
this assignment, is that no libraries are allowed in the deliverable.
In other words, Boost is out, because the submission must only be
source code.

I would appreciate any advice on how you guys get such information
about a file system in your programs, or if you know of any helpful
resources. Thanks.


Look at boost::filesystem
 
F

Frank Birbacher

Hi!

Ian said:
Well boost.filesystem is header only, so if the rules are flexible, it
might be OK.

It is not. Boost filesystem needs .cpp files and even depends on the
Boost System library.

But the OP might as well include the whole boost source code in its
delivery. ;) Or at least the parts needed.

I think this is either a class about C++ programming, in which case you
cannot traverse the directories at all, or this is a Unix programming
class, in which case you can use the POSIX functions. Either way ask the
teacher about it.

Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top