Open write files with partial replacement writes
This commit is contained in:
parent
81032e3b0b
commit
abe4c38571
@ -73,7 +73,7 @@ class ServerUnit extends Unit {
|
||||
const placeholder = socket.session.temp_write_files?.[node.uuid] || await tmp.file()
|
||||
socket.session.temp_write_files[node.uuid] = placeholder
|
||||
|
||||
console.log('Upload placeholder!', placeholder)
|
||||
console.log('Upload placeholder:', placeholder)
|
||||
|
||||
const old_file = await node.uploaded_file()
|
||||
if ( old_file ) {
|
||||
@ -89,7 +89,7 @@ class ServerUnit extends Unit {
|
||||
console.log('write stream', stream)
|
||||
console.log('write data', { placeholder, position, length })
|
||||
|
||||
stream.pipe(fs.createWriteStream(placeholder.path, { start: position }))
|
||||
stream.pipe(fs.createWriteStream(placeholder.path, { flags: 'r+', start: position }))
|
||||
}
|
||||
|
||||
_bufferStream(stream) {
|
||||
|
Loading…
Reference in New Issue
Block a user