Prev: QNAN ????
Next: Find Sub Folder Name within a Folder
From: LondonLad on 12 Jul 2010 04:39 Hi To find a list of files within a folder no problem, but I am stuck trying to find all folder names within a folder In folder Music I have 900 folders of the artists name I want to loop through each folder to check the data created. Can you help please?
From: Dave O. on 12 Jul 2010 05:30 Post the code you are using to find files at the moment because there should be little difference between finding files and finding folders. The best way to find files is to use the FindFirst, FindNext and FindClose triplet of APIs, this returns files & folders and all you need to do is test their attributes to work out which is which. The worst way is by using the File System Object (FSO) which is utter garbage and should avoided at any cost. Anyway you said on an earlier message: "Finding all files with named extn on a single drive I have no problems with", to do that you must check every folder on a drive so you must already know how to find folders so why are you asking here or was the previous statement not quite true? Regards DaveO. "LondonLad" <LondonLad(a)discussions.microsoft.com> wrote in message news:49528ED8-ED73-45D5-8B8C-47BF18F6C7AA(a)microsoft.com... > Hi > To find a list of files within a folder no problem, but I am stuck trying > to > find all folder names within a folder > In folder Music I have 900 folders of the artists name I want to loop > through each folder to check the data created. > Can you help please?
From: LondonLad on 12 Jul 2010 09:37 Hi Dave O Sorry about the double post I did understand what was being said. For some reason I could not see my original post. I am using part of the code written by Randy Birch to get Modified date from the folder but could not get the find folder part thats why I posted. I am now adding FindFirstFile: Changing File and/or Folder Attributes Recursively also by Randy not quite sure how this is getting what I want need to investigate further. Thanks to all who posted. "Dave O." wrote: > Post the code you are using to find files at the moment because there should > be little difference between finding files and finding folders. > The best way to find files is to use the FindFirst, FindNext and FindClose > triplet of APIs, this returns files & folders and all you need to do is test > their attributes to work out which is which. > The worst way is by using the File System Object (FSO) which is utter > garbage and should avoided at any cost. > > Anyway you said on an earlier message: "Finding all files with named extn on > a single drive I have no problems with", to do that you must check every > folder on a drive so you must already know how to find folders so why are > you asking here or was the previous statement not quite true? > > Regards > DaveO. > > "LondonLad" <LondonLad(a)discussions.microsoft.com> wrote in message > news:49528ED8-ED73-45D5-8B8C-47BF18F6C7AA(a)microsoft.com... > > Hi > > To find a list of files within a folder no problem, but I am stuck trying > > to > > find all folder names within a folder > > In folder Music I have 900 folders of the artists name I want to loop > > through each folder to check the data created. > > Can you help please? > > > . >
From: Dave O. on 12 Jul 2010 10:13 "LondonLad" <LondonLad(a)discussions.microsoft.com> wrote in message news:195ACFD6-F66C-4BC4-A9B7-3AF4000FA938(a)microsoft.com... > Hi Dave O > Sorry about the double post I did understand what was being said. For some > reason I could not see my original post. > I am using part of the code written by Randy Birch to get Modified date > from > the folder but could not get the find folder part thats why I posted. > I am now adding FindFirstFile: Changing File and/or Folder Attributes > Recursively also by Randy not quite sure how this is getting what I want > need to investigate further. > Thanks to all who posted. Good, look carefully at the WFD32 structure returned by FindFirstFile/FindNextFile it contains pretty much everything you could need, file/folder name, attributes, all 3 dates and file size well into the Exabyte range (10^18), so using a simple recursive routine based on one from Randy you can solve this yourself. One tripping point you should be aware of is that dates are stored in GMT, so you should investigate the FileTimeToLocalFileTime API. If the FileTime date format is awkward you might want to check out FileTimeToSystemTime and then possibly SystemTimeToVariantTime. Regards Dave O.
From: Kevin Provance on 12 Jul 2010 10:51
"LondonLad" <LondonLad(a)discussions.microsoft.com> wrote in message news:195ACFD6-F66C-4BC4-A9B7-3AF4000FA938(a)microsoft.com... : Hi Dave O : Sorry about the double post I did understand what was being said. For some : reason I could not see my original post. : I am using part of the code written by Randy Birch to get Modified date from : the folder but could not get the find folder part thats why I posted. : I am now adding FindFirstFile: Changing File and/or Folder Attributes : Recursively also by Randy not quite sure how this is getting what I want : need to investigate further. : Thanks to all who posted. : What did I freaking say last week? The dude was going to cut and paste in the code and come back here whining that it doesn't work. It's like watching a 13 year old boy with a 30 year old pro. He wants it, but he doesn't know what to do with it. Look, it's obvious you have no clue what you're doing...even looking at someone elses code. That said, go to planet source code, use their search function for MP3/music players, or maybe explorer clones and just take whatever you find. I suggest this because no matter what you get told here, you won't understand it. You really need to get that Dummies book I recommended earlier if for no other reason that to understand what you are working with. You should also post your code, including what you have tried. It sounds like you are saying, "I have Randy's code here, but I don't get it". Otherwise, let's see what you have tried thus far. |