Mailinglist Archive: opensuse-programming (32 mails)
| < Previous | Next > |
Directory Handling -- New to C++
- From: <linuxdev@xxxxxxxx>
- Date: Tue, 21 Dec 2004 16:43:16 -0600
- Message-id: <200412211643.16072.linuxdev@xxxxxxxx>
Hello,
I am trying to write a program in C++ and I need to check to see if a
directory exists, if not create it, move a file and verify that all works
well. How do I go about this in Linux?
This is a slightly better description:
I am reading a running a program and passing a filename of a binary file as a
command line argument. In this file I extract information that will be
stored in a database, and then the file will be moved to a certain directory
for usage by another application.
Where I put the file depends on information I get from the DB. The base
directory will be the same but subdirectories will be different. Therefore,
I must check to see if the directory and file exists, if not I create the
directory and then move the file from the location specified by the command
line arguments to the new location.
Any help will be appreciated. Again, please make it simple. I am still a bit
ignorant in the C++ world (especially in Linux).
Using SuSE 9.1 Pro, gcc-3.3.3-41
Thanks,
DC
I am trying to write a program in C++ and I need to check to see if a
directory exists, if not create it, move a file and verify that all works
well. How do I go about this in Linux?
This is a slightly better description:
I am reading a running a program and passing a filename of a binary file as a
command line argument. In this file I extract information that will be
stored in a database, and then the file will be moved to a certain directory
for usage by another application.
Where I put the file depends on information I get from the DB. The base
directory will be the same but subdirectories will be different. Therefore,
I must check to see if the directory and file exists, if not I create the
directory and then move the file from the location specified by the command
line arguments to the new location.
Any help will be appreciated. Again, please make it simple. I am still a bit
ignorant in the C++ world (especially in Linux).
Using SuSE 9.1 Pro, gcc-3.3.3-41
Thanks,
DC
| < Previous | Next > |