Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Simon Arnold
  Where is Simon Arnold?
 Halifax
 United Kingdom
 Simon Arnold
 To: Simon Arnold
  Where is Simon Arnold?
 Halifax
 United Kingdom
 Simon Arnold
 Tags
Subject: RE: Found a Little Quirk with ADIR
Thread ID: 464 Message ID: 465 # Views: 4 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Thursday, May 31, 2001 2:08:45 AM         
   


> Just thought I would let you know I have found a small problem with the ADIR command, I'm not quite sure if its supposed to work this way or not.
>
> Problem try to obtain the subdirectories from under another directory.
>
> =ADIR(aDir,"C:\Program Files\","D") && You would expect all the directories under this folder right, wrong you will get two these are . and ..
>
> if you try =ADIR(aDir,"C:\Winnt\*","D") && you get all directories and files.
>
> The only way I have managed to get ADIR to return the subdirectories is to change to that directory first then issue =ADIR(aDir,"","D") && This works....
>
> The only problem with the working method is that you have to store your current path
> SYS(5) + CURDIR() then issue a SET DEFA TO newpath
>
> I don't like to change the working directory from within the program at runtime, as If you forget to reset the default path, you can run into a few problems.
>
> I do have a few work arounds to this problem, but I just thought I would share this Microsoft Feature to the Foxite community.
>
>
> Thanks
>
> Simon Arnold
> Westlake Computer Systems Ltd.
> Halifax, UK.
> simon.arnold@foxite.com

This is what comes of not reading the Help, the third parameter is to allow the inclusion of this type, so adding a D means you will get both Files and Directories.

Sorry my mistake, but we are only human, to really mess things up we need a computer.



ENTIRE THREAD

Found a Little Quirk with ADIR Posted by Simon Arnold @ 5/31/2001 2:00:51 AM
RE: Found a Little Quirk with ADIR Posted by Simon Arnold @ 5/31/2001 2:08:45 AM
RE: Found a Little Quirk with ADIR Posted by Eric den Doop @ 5/31/2001 2:13:34 AM