[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add backup option to convert-ly (Issue 3572) (issue 14040043)
From: |
Eluze |
Subject: |
Re: Add backup option to convert-ly (Issue 3572) (issue 14040043) |
Date: |
Fri, 4 Oct 2013 09:25:55 -0700 (PDT) |
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.
Re: Add backup option to convert-ly (Issue 3572) (issue 14040043), dak, 2013/10/04
Re: Add backup option to convert-ly (Issue 3572) (issue 14040043), dak, 2013/10/04