示例#1
0
def get_temp_copy(path):
    """Returns a copy of the file with the same extension"""

    ext = os.path.splitext(path)[-1]
    fd, filename = mkstemp(suffix=ext)
    os.close(fd)
    shutil.copy(path, filename)
    return filename
示例#2
0
def get_temp_copy(path):
    """Returns a copy of the file with the same extension"""

    ext = os.path.splitext(path)[-1]
    fd, filename = mkstemp(suffix=ext)
    os.close(fd)
    shutil.copy(path, filename)
    return filename
示例#3
0
def get_temp_empty(ext=""):
    """Returns an empty file with the extension"""

    fd, filename = mkstemp(suffix=ext)
    os.close(fd)
    return filename
示例#4
0
def get_temp_empty(ext=""):
    """Returns an empty file with the extension"""

    fd, filename = mkstemp(suffix=ext)
    os.close(fd)
    return filename