![]() |
|
#11
|
|||
|
|||
|
okay, i think one problem was that inorder to open a subdirectory, the complete path of it should be given to opendir().
so i modified the code as follows: CPP / C++ / C Code:
so first 1) Is there a way that my program would find the current compelte path? 2) But now after the subdir is opened, the files does not open. can anyone give me suggestions on how to attack the above two issues? Thank you, Nina |
|||
|
#12
|
|||
|
|||
|
Quote:
1. You give it the path any way that you want it to. The program can't automatically find anything. How would it know? There is no operating system-independent method for a program to discover unambiguously the absolute path to itself, I think. You can use a command line argument or you can hard code it directly into the program. Or you can use a path relative to the location of the executable file. If the directories are subdirectories of place where the executable code resides, you can use "." as the top directory name. 2. I think you have the right idea. You need to see what the program is seeing when it tries to open a file. So you can do something like this: CPP / C++ / C Code:
Get the idea? Once the program is up and almost running, make the program itself tell you what's happening. You can use this to see what's wrong (or to ask questions that someone else might be able to help you answer). Regards, Dave |
|
#13
|
||||
|
||||
|
Quote:
Quote:
And in fact it does -- here. You just had to know what to look for... __________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple question about file opening | eddo | C++ Forum | 3 | 09-Jun-2005 23:04 |
| not opening file correctly | M3X | C++ Forum | 3 | 16-Apr-2005 12:10 |
| Problem opening .mdb files with CDaoDatabase | shvalb | MS Visual C++ / MFC Forum | 0 | 08-Mar-2005 07:07 |
| opening files and displaying text | pin215 | C++ Forum | 7 | 21-Feb-2004 22:27 |
| Opening files with a twist, C++ | calculus87 | C++ Forum | 2 | 26-Sep-2003 15:41 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The