Open GingerManiac opened 4 years ago
Honestly, you should probably just make sure your temp and save dir are on the same device. If they aren't the script will not perform as well.
Yes, changing os.replace to shutil.move would be easy and is probably what I should have been doing anyway, but same device moves are near-instantaneous. Copying from one device to another is not. The recording thread will be held up during this transfer, and if it's a false stop that means you're missing part of the recording while it copies over.
I could open a separate thread for the move, I guess. That's probably fine for the master branch, though the current working branch (hls-python
) has too many threads as is.
I've gone ahead and implemented this with 3f1a509d5d525add37f922fc72b2f319a5d60bd3 , but I'm going to leave the issue to remind myself both to address it on the hls-python branch, and to do something to avoid the copy blocking.
unable to set temp directory when save dir and temp dir not in same partition, because os.replace doesn't support.
i'm using seperated partitions and wish to set temp dir on /tmp on sda1 and save dir on /home on sdb1, but i couldn't do that, cuz of what i wrote above. hope to be changed shutil.move rather than os.replace, then it will be fixed i think, if you don't mind, please.