Description
Whe the current directory FS (disk/partition) where dir2ogg is called from differs from the destination directory FS (disk/partition) of final files, then dir2ogg will fail like:
File "/usr/bin/dir2ogg", line 398, in decode
os.rename(tempwav, self.songwav)
OSError: [Errno 18] Invalid cross-device link
The following patch prevents such failure:
diff -Naur fastoggenc-old/fastoggenc fastoggenc/fastoggenc
--- fastoggenc-old/fastoggenc 2017-04-15 15:29:34.400646642 -0600
+++ fastoggenc/fastoggenc 2017-04-15 15:30:28.471085075 -0600
@@ -39,6 +39,7 @@
import sys
import gettext
import os, os.path
+import shutil
import re
import multiprocessing
import threading
@@ -546,7 +547,7 @@
if self.decoder == 'mplayer':
# Move the file for mplayer (which uses tempwav), so it works
# for --preserve-wav.
- os.rename(tempwav, self.songwav)
+ shutil.move(tempwav, self.songwav)
if retcode != 0:
return (False, None)
else:
I imagine there's another way around the issue, and it's making sure the temporal files are generated in the final destination rather than current directory, but in the end using shutil.move is a good easy solution, :-) See: