summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-08-31 12:59:05 +0000
committerMatt Wilson <msw@redhat.com>1999-08-31 12:59:05 +0000
commit9b701e7c3c6b297f193baf6ccd8f6d9733c61bc5 (patch)
tree74f99538f1b0acd35828be2472c66c04c00918cb /iutil.py
parenta9dd81e45520d3a3cf97c28f770718a02550a4ab (diff)
downloadanaconda-9b701e7c3c6b297f193baf6ccd8f6d9733c61bc5.tar.gz
anaconda-9b701e7c3c6b297f193baf6ccd8f6d9733c61bc5.tar.xz
anaconda-9b701e7c3c6b297f193baf6ccd8f6d9733c61bc5.zip
added copyfile
Diffstat (limited to 'iutil.py')
-rw-r--r--iutil.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/iutil.py b/iutil.py
index 2ef20d186..6abb76b5f 100644
--- a/iutil.py
+++ b/iutil.py
@@ -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)