Commit b1f5f433 authored by Yong Tang's avatar Yong Tang Committed by Jonathan Hseu
Browse files

Support CopyFile with streaming (#12658)



* Support CopyFile with streaming

This fix tries to address the issue raised in 12641 where
it was not possible to have CopyFile with streaming. The original
implementation copies the whole content of the file to a string
buffer and write to the file. This could be an issue
if the file size is large (than memory of the host).

This fix streams the CopyFile operation.

This fix fixes 12641.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Use sendfile for CopyFile implementation in Linux

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Merge CopyFile for same fs and different fs

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* `sendfile64` -> `sendfile` to fix Android build

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Add sendfile processing for Darwin

This commit adds sendfile processing for OSX Darwin.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Not using sendfile in MacOSX

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Address review feedback

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Remove the size check and test OUT_OF_RANGE instead.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Small fixes

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Rename CopyFile to FileSystemCopyFile to fix Windows build errors

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
parent 17ffceb0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment