Is there restrictions on recursive directory listing

Just starting out? Need help? Post your questions and find answers here.
Pot Noodle
Enthusiast
Enthusiast
Posts: 202
Joined: Sat Feb 18, 2012 10:21 pm
Location: Leicestershire

Is there restrictions on recursive directory listing

Post by Pot Noodle »

Hi,
I was wondering if there is a way to do a recursive directory/file listing in PB
As I have tried to do it in Visual Basic but got stuck when I tried to search a protected folder
in Windows 7, Is there a way around the in PB ?

Thanks
P.N.
User avatar
Demivec
Addict
Addict
Posts: 4270
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Is there restrictions on recursive directory listing

Post by Demivec »

There's been several solutions posted in the forum.

Here's one.
Pot Noodle
Enthusiast
Enthusiast
Posts: 202
Joined: Sat Feb 18, 2012 10:21 pm
Location: Leicestershire

Re: Is there restrictions on recursive directory listing

Post by Pot Noodle »

Thanks Demivec didn't notice that one :oops:
P.N.
User avatar
Demivec
Addict
Addict
Posts: 4270
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Is there restrictions on recursive directory listing

Post by Demivec »

Pot Noodle wrote:Thanks Demivec didn't notice that one :oops:
Your welcome.

Your thread topic here doesn't seem to match your intentions. You wanted a recursive directory listing, not an answer to restrictions on a listing. :wink:
Pot Noodle
Enthusiast
Enthusiast
Posts: 202
Joined: Sat Feb 18, 2012 10:21 pm
Location: Leicestershire

Re: Is there restrictions on recursive directory listing

Post by Pot Noodle »

No not really, You see when I was running XP I wrote a program to keep your hard drive clean and free from junk etc..
But now in windows 7 the same program just wont run due to the directory structure now used.
When I ran the program I got unauthorizedAccessException error, I tried to catch the error and carry on
but the program would always holt at this point, Reading about it on the Microsoft web site didn't help
as it was all gobbledigook to me. :mrgreen:
P.N.
Pud
User
User
Posts: 29
Joined: Mon Dec 28, 2009 2:23 am

Re: Is there restrictions on recursive directory listing

Post by Pud »

(Recursive) recursive directory listing.

Procedure dir(path$,h)

ExamineDirectory(h,path$,"*.*")
While NextDirectoryEntry(h)
If DirectoryEntryType(h)=#PB_DirectoryEntry_File
Debug path$+DirectoryEntryName(h)
ElseIf DirectoryEntryName(h)<>"." And DirectoryEntryName(h)<>".."
dir(path$+"\"+DirectoryEntryName(h),h+1)
EndIf
Wend
FinishDirectory(h)

EndProcedure

dir("c:\windows",0) ; for example
Post Reply