예제 #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)
예제 #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)
예제 #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)
예제 #4
0
def touch(location, mode=None, owner=None, group=None):
    core.run('touch %s' % location)
    attributes(location, mode=mode, owner=owner, group=group)
예제 #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
예제 #6
0
def temp(mode=None, owner=None, group=None):
    path = run('mktemp --directory')
    attributes(path, mode=mode, owner=owner, group=group)
    return path
예제 #7
0
파일: file.py 프로젝트: 5monkeys/revolver
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)