This file is indexed.

/usr/share/pyshared/landscape/lib/fs.py is in landscape-common 12.04.3-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""File-system utils"""

import os


def create_file(path, content):
    """Create a file with the given content.

    @param path: The path to the file.
    @param content: The content to be written in the file.
    """
    fd = open(path, "w")
    fd.write(content)
    fd.close()


def append_file(path, content):
    """Append a file with the given content.

    The file is created, if it doesn't exist already.

    @param path: The path to the file.
    @param content: The content to be written in the file at the end.
    """
    fd = open(path, "a")
    fd.write(content)
    fd.close()


def read_file(path, limit=None):
    """Return the content of the given file.

    @param path: The path to the file.
    @param limit: An optional read limit. If positive, read up to that number
        of bytes from the beginning of the file. If negative, read up to that
        number of bytes from the end of the file.
    @return content: The content of the file, possibly trimmed to C{limit}.
    """
    fd = open(path, "r")
    if limit and os.path.getsize(path) > abs(limit):
        whence = 0
        if limit < 0:
            whence = 2
        fd.seek(limit, whence)
    content = fd.read()
    fd.close()
    return content


def touch_file(path):
    """Touch a file, creating it if it doesn't exist."""
    fd = open(path, "a")
    fd.close()
    os.utime(path, None)