diff options
Diffstat (limited to 'src/carquinyol/filestore.py')
-rw-r--r-- | src/carquinyol/filestore.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/carquinyol/filestore.py b/src/carquinyol/filestore.py index 9724397..9eb975f 100644 --- a/src/carquinyol/filestore.py +++ b/src/carquinyol/filestore.py @@ -43,6 +43,14 @@ class FileStore(object): if file_path: if not os.path.isfile(file_path): raise ValueError('No file at %r' % file_path) + + if os.path.islink(file_path): + # Can't keep symlinks (especially pointed to removable medias). + # Later, optimizer will help with saving duplicates + file_path = os.path.realpath(file_path) + # We should not move original file + transfer_ownership = False + if transfer_ownership: try: logging.debug('FileStore moving from %r to %r', file_path, |