Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

find ALL files in folder and sub folders...how?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-03-2009, 10:08 AM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default find ALL files in folder and sub folders...how?

I thought much but and have not found a beautiful way...
how can i find ALL files in given dir?include subdirs
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #2 (permalink)  
Old 01-03-2009, 10:28 AM
Filippo's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 977
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Byak@,

shows my example:
http://www.basic4ppc.com/forum/share...html#post13867


Ciao,
Filippo
__________________
PPC: MDA Pro, 2GB SD
Device: HTC Desire , Android 2.2
______________________
Reply With Quote
  #3 (permalink)  
Old 01-03-2009, 10:49 AM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Greating Flippo)i'm work with soirce of your explorer but not find,how can i do it.you find files in subfolder when click it.but i must find all files at once
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #4 (permalink)  
Old 01-03-2009, 10:56 AM
Basic4ppc Veteran
 
Join Date: Apr 2008
Location: Gosford NSW Australia
Posts: 223
Send a message via MSN to tsteward
Default

Man get out of my head.
I just asked the same question in a different way.

Anyway looking forward to the solution as I also need to do this!!!
__________________
PC: Dual core 3.4ghz 2gb ram
PPC: I-mate Jasjam
Reply With Quote
  #5 (permalink)  
Old 01-03-2009, 11:32 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

FROM BASIC4PPC HELP

Quote:
DirSearch

--------------------------------------------------------------------------------

Adds all subdirectories matching the search pattern in the specified path to an ArrayList and returns the number found.
Syntax: DirSearch (ArrayList, Path [,Search Pattern])
If the Search Pattern is omitted DirSearch will return all the subdirectories in the directory.
Search Pattern can include '*' and '?'.
* - Finds zero or more characters.
? - Finds exactly one character.
Example: (alDir is an ArrayList control)
FileSearch (alDir, "\My Documents")


This example will add all the subdirectories in My Documents folder (in the device) to the ArrayList alDir.
------------------------------------------------------
Quote:
FileSearch

--------------------------------------------------------------------------------

Adds all files matching the search pattern in the specified path to an ArrayList and returns the number of files found.
Syntax: FileSearch (ArrayList, Path [,Search Pattern])
If the Search Pattern is omitted FileSearch will return all the files in the directory.
Search Pattern can include '*' and '?'.
* - Finds zero or more characters.
? - Finds exactly on character.
Example: (alFiles is an ArrayList control)
FileSearch (alFiles, "\My Documents", "*.txt")


This example will add all the files with txt extension in My Documents folder (in the device) to the ArrayList alFiles.
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #6 (permalink)  
Old 01-03-2009, 12:03 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Cableguy
we know how find files and find folders.but how find files in all subfolders and subsubfolders and sub...subfolders?
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #7 (permalink)  
Old 01-03-2009, 12:21 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

use a bit of logic...
if root folder has subdir, then search each subdir for folders...Until the result is 0Then you will have a series of array with ALL THE SUBFOLDERS OF YOUR MAIN ROOT

Same with the files...

Example:
IF DirSearch(Root(),"\MyDocuments")>0 Then
For x=0 to arraylen(root())-1
Textbox1.text=TextBox1.text&Root(x)&crlf 'this will populate a textbox with the root values
Next
For x=0 to Arraylen(Root())-1
DirSearch(Control(Level(),Root(x))
Textbox1.text=TextBox1.text&Root(x)&crlf
Next
End If

NOTE this is untested code, root and level are arraylist controls...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #8 (permalink)  
Old 01-03-2009, 01:48 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Cableguy you read my post?i must find ALL FILES in folder,sub-folders,subsub-folders,subsubsub-folders,subsubsub-folders...subsubsubsubsubsubsubsubsubsubsubsub-folders.
yes,you may use 1000 cicles and create 1000 arraylists...but i want a beautiful way...

p.s. in your code your have some errors)and your cade show only folders from root
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #9 (permalink)  
Old 01-03-2009, 02:11 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Here:
Code:
Sub Globals
    
'Declare the global variables here.

End Sub

Sub App_Start
    Form1.Show
    FindAllFiles(
"\My Documents")
    
For i = 0 To alFiles.Count-1
        listbox1.Add(FileName(alFiles.Item(i))) 
'Remove FileName if you need the full 
    Next
End Sub

Sub FindAllFiles(root)
    alFolders.Clear 
'ArrayList
    alFiles.Clear 'ArrayList
    alFolders.Add(root)
    i = 
0
    
Do While alFolders.Count > i
        
'search one folder
        currentFolder = alFolders.Item(i)
        DirSearch(alFolders,currentFolder) 
'Add all subfolders in this folder to the list.
        FileSearch(alFiles,currentFolder,"*.*"'Add all files from this folder.
        b = alFiles.Count
        i = i + 
1
    
Loop
End Sub
Reply With Quote
  #10 (permalink)  
Old 01-03-2009, 03:08 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Erel big-big-big thanks!!!i'm don't know what dirsearch add folders to arraylist,i'm think it replace)
big thanks!
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Archiving Folders? Byak@ Questions (Windows Mobile) 3 08-27-2008 03:35 PM
How to find files in a directory pmu5757 Questions (Windows Mobile) 2 05-07-2008 12:37 PM
Source Code Folders On The Device RandomCoder Basic4ppc Wishlist 13 03-23-2008 01:01 PM
Special Folders on PC BPak Questions (Windows Mobile) 2 06-01-2007 09:53 PM
Copying .dll files into the windows folder specci48 Questions (Windows Mobile) 1 05-28-2007 11:50 AM


All times are GMT. The time now is 08:01 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0