Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Opening Files/ Directive / Mixup Problems
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
copthesaint




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
copthesaint




PostPosted: 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




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
copthesaint




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: