mergerfs/tests/TEST_unlink_rename

15 lines
226 B
Plaintext
Raw Normal View History

2019-05-17 02:38:07 +08:00
#!/usr/bin/env python3
import os
import sys
import tempfile
(srcfd,src) = tempfile.mkstemp(dir=sys.argv[1])
(tgtfd,tgt) = tempfile.mkstemp(dir=sys.argv[1])
os.unlink(tgt)
os.rename(src,tgt)
os.close(srcfd)
os.close(tgtfd)