Beispiel #1
0
def create(path, recursive=False, mode=None, owner=None, group=None):
    recursive = recursive and '-p' or ''

    if exists(path):
        return

    run('mkdir %s %s' % (recursive, path))
    attributes(path, mode=mode, owner=owner, group=group)
Beispiel #2
0
def create(path, recursive=False, mode=None, owner=None, group=None):
    recursive = recursive and '-p' or ''

    if exists(path):
        return

    core.run('mkdir %s %s' % (recursive, path))
    attributes(path, mode=mode, owner=owner, group=group)
Beispiel #3
0
def copy(source, destination, force=True, mode=None, owner=None, group=None):
    force = force and '-f' or ''

    core.run('cp %s %s %s' % (force, source, destination))
    attributes(destination, mode=mode, owner=owner, group=group)
Beispiel #4
0
def touch(location, mode=None, owner=None, group=None):
    core.run('touch %s' % location)
    attributes(location, mode=mode, owner=owner, group=group)
Beispiel #5
0
def temp(mode=None, owner=None, group=None):
    path = core.run('mktemp').stdout
    attributes(path, mode=mode, owner=owner, group=group)
    return path
Beispiel #6
0
def temp(mode=None, owner=None, group=None):
    path = run('mktemp --directory')
    attributes(path, mode=mode, owner=owner, group=group)
    return path
Beispiel #7
0
def link(source, destination, symbolic=True, force=True, mode=None, owner=None, group=None):
    force = force and '-f' or ''
    symbolic = symbolic and '-s' or ''

    run('ln %s %s "%s" "%s"' % (symbolic, force, source, destination))
    attributes(destination, mode, owner, group)