ANONYMOUS wrote:
> Hi Chris,
>
> I sent a question in reply to a previous thread from weeks ago, so am linking it here in case you don't get notified of it.
Hello - you posted something at "6:54pm Thu 12th Oct", and then sent me a follow-up at "11:12pm Thu 12th Oct"?
(I receive a copy of every post via email, and can also see them via the 'NEW" menu item, above)
> Hi Chris, with my program, it iterates across each file, and immediately checks other directories to consider if the file should be copied or not. It does not first identify all the files to be copied. It goes between copying and scanning dirs frequently. So far it still works and is aligned to the sample soln, even with -r. However here (in the quote above) you have said that you must first identify what should be copied, before copying. Does this mean that I would be marked down for my alternate approach, even if it achieves the same result?
With your approach, I'm wondering if you perform unnecessary work? -
- you start by scanning dir1
- you find the file dir1/A but dir2/A doesn't exist
- you copy dir1/A to dir2/A
- you finish scanning dir1
- you start scanning dir2
- you find dir2/A and it is (now) newer than dir1/A
- you copy dir2/A to dir1/A
??????????????????????????
I also think that this approach is the cause for students asking about creating infinite chains of
subdirectories.