dak wrote > Eluze < > eluzew@
> > writes: > >> 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. > > Wrong. os.path.exists (back_up) should be used solely since we are > looking for an _unused_ file name. If there is a directory called > file.ly.~1~ we have to skip this just as much in our search as if there > is a file called file.ly.~1~ as we don't want to overwrite either > existing files or existing directories. ok - so because it's not possible to have a directory and a file with the same name in the same location we have to check for the path-name... thanks for your help in clarifying! Eluze -- View this message in context: http://lilypond.1069038.n5.nabble.com/Add-backup-option-to-convert-ly-Issue-3572-issue-14040043-tp151484p151850.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
