diff options
author | Matt Wilson <msw@redhat.com> | 1999-08-31 12:59:05 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 1999-08-31 12:59:05 +0000 |
commit | 9b701e7c3c6b297f193baf6ccd8f6d9733c61bc5 (patch) | |
tree | 74f99538f1b0acd35828be2472c66c04c00918cb /iutil.py | |
parent | a9dd81e45520d3a3cf97c28f770718a02550a4ab (diff) | |
download | anaconda-9b701e7c3c6b297f193baf6ccd8f6d9733c61bc5.tar.gz anaconda-9b701e7c3c6b297f193baf6ccd8f6d9733c61bc5.tar.xz anaconda-9b701e7c3c6b297f193baf6ccd8f6d9733c61bc5.zip |
added copyfile
Diffstat (limited to 'iutil.py')
-rw-r--r-- | iutil.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -76,3 +76,15 @@ def execWithCapture(command, argv, searchPath = 0, root = '/', stdin = 0): os.waitpid(childpid, 0) return rc + +def copyFile(source, to): + f = os.open(source, os.O_RDONLY) + t = os.open(to, os.O_RDWR | os.O_TRUNC | os.O_CREAT) + + count = os.read(f, 16384) + while (count): + os.write(t, count) + count = os.read(f, 16384) + + os.close(f) + os.close(t) |