
-----------------------------------
1of42
Fri Apr 01, 2005 1:04 pm

File manipulation in C++
-----------------------------------
Are there any built-in libraries or classes for manipulating files in C++? I'm looking for something analagous to the Java File class.

Note: I do not mean libraries for file I/O... I'm looking for functions/libraries that will enable me to move functions around, create directories, move directories, etc etc etc...

-----------------------------------
Mazer
Fri Apr 01, 2005 1:12 pm


-----------------------------------
Not standard, no, but there is a [url=http://www.boost.org/libs/filesystem/doc/index.htm]Boost library available. I've used it before, it works.

-----------------------------------
OMouse
Wed Apr 06, 2005 6:22 pm


-----------------------------------
Umm. You can always use system() to execute any commands you might need.

There may be an API for windows that lets you create directories with a function call, I know there's one for Visual Basic.

-OMouse

-----------------------------------
Martin
Wed Apr 06, 2005 9:26 pm


-----------------------------------
Avoid system calls like the plague. They'll only ever cause you problems later when stuff changes (and any chance of platform independance gets shot to hell).

-----------------------------------
OMouse
Thu Apr 07, 2005 7:18 pm


-----------------------------------
The commands for creating new directories is the same in *NIX and DOS i believe. And you only have to switch two times even if it is different. Once to check for windows and once to check for some *nix distro.

Not that difficult.

-----------------------------------
wtd
Thu Apr 07, 2005 7:30 pm


-----------------------------------
The commands for creating new directories is the same in *NIX and DOS i believe. And you only have to switch two times even if it is different. Once to check for windows and once to check for some *nix distro.

Not that difficult.

Very fragile, though.  The boost libraries are a far better solution.
