~ubuntu-branches/ubuntu/lucid/landscape-client/lucid-updates

« back to all changes in this revision

Viewing changes to landscape/lib/fs.py

  • Committer: Package Import Robot
  • Author(s): Andreas Hasenack
  • Date: 2012-04-10 14:28:48 UTC
  • mfrom: (1.1.27)
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: package-import@ubuntu.com-20120410142848-7xsy4g2xii7y7ntc
ImportĀ upstreamĀ versionĀ 12.04.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
    fd.close()
15
15
 
16
16
 
 
17
def append_file(path, content):
 
18
    """Append a file with the given content.
 
19
 
 
20
    The file is created, if it doesn't exist already.
 
21
 
 
22
    @param path: The path to the file.
 
23
    @param content: The content to be written in the file at the end.
 
24
    """
 
25
    fd = open(path, "a")
 
26
    fd.write(content)
 
27
    fd.close()
 
28
 
 
29
 
17
30
def read_file(path, limit=None):
18
31
    """Return the content of the given file.
19
32