Exemple #1
0
def get_file_type(filename):
    get = FileInfo(('pfileinfo','-v','0',
                    'type','--type-only',property_name,filename))
    result = get.run()
    if result != 0:
        return None
    result = get.get_stdout_msg()
    if len(result) and result[-1] == '\n':
        result = result[:-1]
    return result
Exemple #2
0
def get_file_type(filename):
    get = FileInfo(('pfileinfo', '-v', '0', 'type', '--type-only',
                    property_name, filename))
    result = get.run()
    if result != 0:
        return None
    result = get.get_stdout_msg()
    if len(result) and result[-1] == '\n':
        result = result[:-1]
    return result
Exemple #3
0
def get_file_property(filename, property_name):
    get = FileInfo(('pfileinfo','-v','0',
                    'get','--value-only',property_name,filename))
    try:
        result = get.run()
    except ECommand:
        return None
    if result != 0:
        return None
    result = get.get_stdout_msg()
    if len(result) and result[-1] == '\n':
        result = result[:-1]
    return result
Exemple #4
0
def get_file_property(filename, property_name):
    get = FileInfo(('pfileinfo', '-v', '0', 'get', '--value-only',
                    property_name, filename))
    try:
        result = get.run()
    except ECommand:
        return None
    if result != 0:
        return None
    result = get.get_stdout_msg()
    if len(result) and result[-1] == '\n':
        result = result[:-1]
    return result
Exemple #5
0
def set_file_property(filename, property_name, property_value):
    set = FileInfo(('pfileinfo','-v','0',
                    'set',property_name,property_value,filename,filename))
    result = set.run()
    return result
Exemple #6
0
def set_file_property(filename, property_name, property_value):
    set = FileInfo(('pfileinfo', '-v', '0', 'set', property_name,
                    property_value, filename, filename))
    result = set.run()
    return result