flying-circus / pyfilesystem

Automatically exported from code.google.com/p/pyfilesystem
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

fs.Base.createfile purpose has changed over the time #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Look at current code and one from some weeks ago for fs.Base.createfile
2. Check that being called the same, they have different description and 
parameters

What is the expected output? What do you see instead?

They should be the same or new one being improved over the old one... and see 
that they have different purposes

Old (from before 15-April-2011):
    def createfile(self, path, data=""):
        """A convenience method to create a new file from a string.

        :param path: a path of the file to create
        :param data: a string or a file-like object containing the contents for the new file
        """

New:
    def createfile(self, path, wipe=False):
        """Creates an empty file if it doesn't exist

        :param path: path to the file to create
        :param wipe: if True, the contents of the file will be erased 

        """

I don't know what should be the correct functionality... :-/

Original issue reported on code.google.com by piranna on 7 Jul 2011 at 10:06

GoogleCodeExporter commented 9 years ago
createfile was originally an alias for setcontents. But a separate method to 
just create a blank file is quite useful. If you do have any calls to 
'createfile' you can replace them with a setcontents call.

Original comment by willmcgugan on 7 Aug 2011 at 10:21