File backup app [SOLVED]

I want to be a little more selective, rather than an indiscriminate
operation, such as if the src file is identical to the dst file, then
leave it as is, if not, then make a copy. On that last part, I think
that using shutil.copy2() may be a better option than my read/write
byte
objects

function.

Yes. It depends how much you want to implement yourself for learning or
fine tuned control purposes. I’ve assuming you want that, or you’d just
be using rsync :slight_smile:

This function:

def get_manifest(src):
   manifest = []
   for dirname, dirnames, filenames in os.walk(src):
       if filenames:

You don’t need this if-statement; you for-loop will just append 0 files
if filenames is empty, which is fine.

           for filename in filenames:
               manifest.append(f"{dirname}/{filename}")

A purist might suggest that portable code might just use os.path.join
here, avoiding special hardwired knowledge of the path separator. Though
/ works in windows these days.

I tend to use dirpath instead of dirname to remind myself that it
looks like /path/to/the/subdir. Leaving dirname free if you wanted
to iterate on dirnames.

Cheers,
Cameron Simpson cs@cskk.id.au