Author |
Message |
copthesaint
|
Posted: Mon Feb 09, 2009 11:52 am Post subject: Opening Files/ Directive / Mixup Problems |
|
|
Ok so I was wanting to make a program that will open up all picture files in all folders at the location of the File.
But when ever I try to do this I will get an error.
Example
-Folder (b)
-File (The program)
-Folder (a)
-Folder
-Folder
First it will open it's self and search the folder it is in
Second It will Search the folder that is outside of it.
Third it will Seach The folder (a) but Out side on of folder (b)
This will then give me the error
Also for some reason it tries to open .t files...
and This program does open pictures. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Mon Feb 09, 2009 5:33 pm Post subject: RE:Opening Files/ Directive / Mixup Problems |
|
|
it is best to traverse the directory structure in a recursive manner. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
copthesaint
|
Posted: Mon Feb 09, 2009 8:27 pm Post subject: RE:Opening Files/ Directive / Mixup Problems |
|
|
??? Sorry recursive?
I'm just starting my grade 10 computer class so I don't actually know the terminology. (I CAN'T SKIP A GRADE TO JAVA>_<) |
|
|
|
|
|
Tony
|
Posted: Mon Feb 09, 2009 8:39 pm Post subject: RE:Opening Files/ Directive / Mixup Problems |
|
|
[url]http://en.wikipedia.org/wiki/Recursion_(computer_science)[/url]
Create a function read_files_in_directory(). There's an example of that in Turing Reference file under Dir. Inside that function, if one of the files read is a directory, call read_files_in_directory(), to read the contents of that directory. When the function returns, the calling function will continue on to the next file. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
copthesaint
|
Posted: Tue Feb 10, 2009 8:08 am Post subject: RE:Opening Files/ Directive / Mixup Problems |
|
|
Yes know This allready and I was basing my program off several programs in the help menus. |
|
|
|
|
|
|