Phil Holmes wrote >> >> And while we are at it: the loop has the condition >> while os.path.exists(back_up) and os.path.isfile(back_up): >> for skipping over existing files. The second part of the condition is >> nonsensical since it means that a name will be used for backing up even >> if it is already taken by a directory or fifo or socket. >> >> https://codereview.appspot.com/14040043/ > > I presume Eluze put it in for a specific reason which I don't know. > Eluze?
well - as you certainly guess, the code isn't purely mine and I was already wondering why there are these two conditions. now reading a little bit more I found that "A path is an unambiguous pointer to a resource in the file system. It can either point to a file or to a directory." this seems exactly what we don't want, we don't deal with directories here - so it's sufficient to test if it is an existing /file/: *os.path.isfile(back_up)* should be used solely. hope pythonists can agree or explain better. Eluze -- View this message in context: http://lilypond.1069038.n5.nabble.com/Add-backup-option-to-convert-ly-Issue-3572-issue-14040043-tp151484p151832.html Sent from the Dev mailing list archive at Nabble.com. _______________________________________________ lilypond-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-devel
