MCPcopy Index your code
hub / github.com/PyTables/PyTables / copyFileToFile

Function copyFileToFile

tables/nodes/tests/test_filenode.py:163–174  ·  view source on GitHub ↗

copyFileToFile(srcfile, dstfile[, blocksize]) -> None Copies a readable opened file 'srcfile' to a writable opened file 'destfile' in blocks of 'blocksize' bytes (4 KiB by default).

(srcfile, dstfile, blocksize=4096)

Source from the content-addressed store, hash-verified

161
162
163def copyFileToFile(srcfile, dstfile, blocksize=4096):
164 """copyFileToFile(srcfile, dstfile[, blocksize]) -> None
165
166 Copies a readable opened file 'srcfile' to a writable opened file
167 'destfile' in blocks of 'blocksize' bytes (4 KiB by default).
168
169 """
170
171 data = srcfile.read(blocksize)
172 while len(data) > 0:
173 dstfile.write(data)
174 data = srcfile.read(blocksize)
175
176
177class WriteFileTestCase(TempFileMixin, TestCase):

Callers 2

test00_WriteFileMethod · 0.85
setUpMethod · 0.85

Calls 2

writeMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected