[DUG] FindFirst on a CD drive

Phil Middlemiss phil at tumonz.co.nz
Wed Dec 20 08:37:39 NZDT 2006


OK, found the problem - Our recursive library routine was indeed calling 
FindClose but it was being called at the wrong point! It was being 
called at the end of the recursion, rather than storing the directories 
found, calling FindClose, and then recursing. A simple case of thinking 
"That routine has been around for ages - I don't need to worry about 
that!" DOH!

There's a lesson in there somewhere, I'm sure of it.

Thanks for the help everyone.

Phil.

Sabu M Hariharan wrote:
> Hi Phil,
>
> Hope you are calling FindClose as the last statement.
>
> Seems it is something related with refreshing..
> May be you can just try by making a dummy call like
> FindFirst('', FileAttrs, sr); before making the real call.
> This may help you. Please try it out.
>
> [I am not sending this mail to the group]
>
> Best regards,
> Sabu M H
>
>
> -----Original Message-----
> From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
> On Behalf Of Phil Middlemiss
> Sent: Tuesday, December 19, 2006 5:54 AM
> To: NZ Borland Developers Group - Delphi List
> Subject: [DUG] FindFirst on a CD drive
>
> Hi guys,
>
> we have a program that copies files from a number of CDs to the hard 
> drive and uses FindFirst recursively to see which files are available on
>
> the CD.
>
> Once it's copied all the files from one CD it asks for the next CD and 
> searches that disc for any files it can copy. This is where it seems to 
> have a problem. On my machine (W2k) everything works fine, on another 
> machine in the office (XP) it doesn't seem to find any files after the 
> disc has been swapped for the next one.
>
> Could this be Windows caching the CD contents? I tried refreshing 
> Explorer to show the actual contents of the second CD (which it did) but
>
> the app still couldn't seem to find any files.
>
> Any ideas what is going on?
>
> Cheers,
> Phil.
> ----------------------------------------------------------------DISCLAIMER---------------------------------------------------------
> Information transmitted by this EMAIL is proprietary to iGATE Group of Companies and is intended for use only by the individual 
> or entity to whom it is addressed and may contain information that is privileged, confidential, or exempt from disclosure under 
> applicable law. If you are not the intended recipient of this EMAIL immediately notify the sender at iGATE or mailadmin at igate.com 
> and delete this EMAIL including any attachments
>
>
>
>
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phil.vcf
Type: text/x-vcard
Size: 250 bytes
Desc: not available
Url : http://ns3.123.co.nz/pipermail/delphi/attachments/20061220/89d1b931/phil.vcf


More information about the Delphi mailing list