5a6 Subj : Re: Findfirst To : borland.public.cpp.borlandcpp From : Ed Mulroy [TeamB] Date : Fri Aug 27 2004 09:24 am The findfirst and findnext functions are only shells around calls to the operating system functions. The behavior you are seeing is that of the OS and its file system. From the behavior you describe the file search is not fully performed and cached at the time of the findfirst call. If you alter a file name in the middle of a findfirst/findnext loop then you risk the new file name appearing as one of those returned later. This behavior used to be common with DOS. 16 bit Windows seemed to do a little caching and 32 bit Windows seems to do a lot of file search caching if the file system is NTFS, less if it is FAT. For tasks like this it might be best to assemble a list of the found names and do the renaming after the findfirst/findnext is done. .. Ed > Georges Ware wrote in message > news:412EFC0B.D00EAA7A@radiolink.me.uk... > Strange problem with findfirst(...) > > I'm trying to use it to rename all the files in a directory, or to > copy > them to a new name in the same directory. > > It goes round the findfirst/findnext loop perfectly except that it > regards the first of the files which it has renamed or copied as > a new file to be renamed!!! It does not regard any of the > subsequent renamed files as find-worthy. > > Anyone any ideas about this ? . 0