Why renames/creates the simple for loop files multiple times?
Posted: 02 Jul 2016 22:56
The issue is described in this stackoverflow answer by debenham:
In my opinion this behaviour is due to compatibility reasons of the FCB structure of CP/M, but I'm not sure.
Does anybody know an other reason and has a link to a technical description?
Thanks for reading
The simple FOR command with wildcards begins iterating files before it finishes reading the entire directory. It buffers a block of files and iterates them, then picks up where it left off. When you rename a file, the renamed file may sort later in the list, and be picked up in a later block of files. Hence the double renaming.
In my opinion this behaviour is due to compatibility reasons of the FCB structure of CP/M, but I'm not sure.
Does anybody know an other reason and has a link to a technical description?
Thanks for reading