~didrocks/ubuntuone-client/use_result_var

« back to all changes in this revision

Viewing changes to ubuntuone/platform/linux/os_helper.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2011-02-11 16:18:11 UTC
  • mto: This revision was merged to the branch mainline in revision 67.
  • Revision ID: james.westby@ubuntu.com-20110211161811-n18dj9lde7dxqjzr
Tags: upstream-1.5.4
ImportĀ upstreamĀ versionĀ 1.5.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
platform = "linux2"
31
31
 
32
32
 
 
33
def set_no_rights(path):
 
34
    """Remove all rights from the file."""
 
35
    os.chmod(path, 0o000)
 
36
 
33
37
def set_file_readonly(path):
34
38
    """Change path permissions to readonly in a file."""
35
39
    os.chmod(path, 0444)
81
85
    """Rename a file or directory."""
82
86
    os.rename(path_from, path_to)
83
87
 
 
88
def make_link(target, destination):
 
89
    """Create a link from the destination to the target."""
 
90
    os.symlink(target, destination)
 
91
 
84
92
def listdir(directory):
85
93
    """List a directory."""
86
94
    return os.listdir(directory)