Computer Science Canada File manipulation in C++ |
Author: | 1of42 [ Fri Apr 01, 2005 1:04 pm ] |
Post subject: | 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... |
Author: | Mazer [ Fri Apr 01, 2005 1:12 pm ] |
Post subject: | |
Not standard, no, but there is a Boost library available. I've used it before, it works. |
Author: | OMouse [ Wed Apr 06, 2005 6:22 pm ] |
Post subject: | |
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 |
Author: | Martin [ Wed Apr 06, 2005 9:26 pm ] |
Post subject: | |
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). |
Author: | OMouse [ Thu Apr 07, 2005 7:18 pm ] |
Post subject: | |
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. |
Author: | wtd [ Thu Apr 07, 2005 7:30 pm ] |
Post subject: | |
OMouse wrote: 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. |
: |