App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Functions | Variables
google.appengine._internal.django.core.files.move Namespace Reference

Functions

def copystat
 
def file_move_safe
 

Variables

list __all__ = ['file_move_safe']
 

Detailed Description

Move a file in the safest way possible::

    >>> from google.appengine._internal.django.core.files.move import file_move_safe
    >>> file_move_safe("/tmp/old_file", "/tmp/new_file")

Function Documentation

def google.appengine._internal.django.core.files.move.copystat (   src,
  dst 
)
Copy all stat info (mode bits, atime and mtime) from src to dst
def google.appengine._internal.django.core.files.move.file_move_safe (   old_file_name,
  new_file_name,
  chunk_size = 1024*64,
  allow_overwrite = False 
)
Moves a file from one location to another in the safest way possible.

First, tries ``os.rename``, which is simple but will break across filesystems.
If that fails, streams manually from one file to another in pure Python.

If the destination file exists and ``allow_overwrite`` is ``False``, this
function will throw an ``IOError``.