summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2013-11-07 00:47:13 +0000
committerRichard Maw <richard.maw@gmail.com>2013-11-07 00:47:13 +0000
commite51dc6c345665dec4632301516553e5cde875298 (patch)
tree8e709617bb598b7e689da96d08db45d4a740a394
parent4c938c5654e83d148c7f546b4f0a14c04047bc9c (diff)
downloadtar-clone-e51dc6c345665dec4632301516553e5cde875298.tar.bz2
Work with large files
-rwxr-xr-xtar-clone.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/tar-clone.lua b/tar-clone.lua
index 6ced918..582fd94 100755
--- a/tar-clone.lua
+++ b/tar-clone.lua
@@ -132,6 +132,7 @@ local function add_dir(writer, basedir, path)
writer:header(entry)
copy_file(fssubpath, function(bytes)
writer:data(bytes)
+ return 0, #bytes
end)
elseif dt == luxio.DT_DIR then
writer:header(entry)
@@ -261,14 +262,17 @@ local function write_index(writer, repo, HEAD, localname)
birthtime = {683074800, 683074800},
}
writer:header(entry)
- copy_file(index, function(data) writer:data(data) end)
+ copy_file(index, function(data)
+ writer:data(data)
+ return 0, #data
+ end)
end
local writer = archive.write{
format = "pax",
writer = function(archive, string)
if string == nil then
- -- pass
+ io.stdout:flush()
else
io.stdout:write(string)
return #string