On Thu, Feb 17, 2011 at 8:59 PM, Joe Yoder <[email protected]> wrote: > I want to store a copy of the complete directory structure of each optical > disc in my media storage system in a VFP table memo field. I considered > using recursion with adir() but concluded that it makes more sense to use > something like the Windows internal command "dir" with the "/s"subdirectories > option as this automatically includes file and folder sizes. > > I have been experimenting with Microsoft example code which uses > CreateProcess and WaitForSingleObject and can have it execute an exe such as > Notepad and wait for it to be closed before returning control to VFP. When I > try to execute the command "Dir" rather than "C:\Windows\System32\Notepad" I > get an error. I think the difference is that 'Dir" is an internal command > but maybe it is just a syntax problem. > > Can someone help me out with the correct CreateProcess syntax or point me to > another function? > > As always - a suggestion for another approach would also be welcome. >
This is an old problem that's been solved before. VFP already has hooks into the underlying OS functionality, so there's no need to build up your own API calls and handle the timing issues. Take a look at: http://fox.wikis.com/wc.dll?Wiki~RecursiveDirectoryProcessing -- Ted Roche Ted Roche & Associates, LLC http://www.tedroche.com _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

