#140453 - spinal_cord - Sun Sep 16, 2007 4:28 pm
This is bugging me a bit, I'm trying to navigate a directory list but I'm getting nowhere.
I have the filename in a string icon[file_to_load].filename[255] and im using a second variable to say if it is a folder or not.
get_file_list(); creates a list of files and folders in the 'folder' directory.
I assube i'm doing this wrong as it doesnt work properly.
If I was doing this in BASIC, i would
But im lost in C, please help!
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage
I have the filename in a string icon[file_to_load].filename[255] and im using a second variable to say if it is a folder or not.
Code: |
if(icon[file_to_load].is_folder) { sprintf(folder,"/%s",folder,icon[file_to_load].filename); get_file_list(); } |
get_file_list(); creates a list of files and folders in the 'folder' directory.
I assube i'm doing this wrong as it doesnt work properly.
If I was doing this in BASIC, i would
Code: |
if icon[file_to_load].is_folder then if icon[file_to_load].filename <>".." then folder$=left$(folder$,len(folder$)-len(icon[file_to_load].filename) get_file_list() else folder$=folder$+"/"+icon[file_to_load].filename get_file_list() end if end if |
But im lost in C, please help!
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage