MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / writeAll

Function writeAll

pages/api/files/upload-chunk.ts:16–21  ·  view source on GitHub ↗
(file: Deno.FsFile, data: Uint8Array)

Source from the content-addressed store, hash-verified

14
15// Deno.FsFile.write() may do short writes (like POSIX write()), so loop until all bytes are written.
16async function writeAll(file: Deno.FsFile, data: Uint8Array): Promise<void> {
17 let offset = 0;
18 while (offset < data.length) {
19 offset += await file.write(data.subarray(offset));
20 }
21}
22
23// Remove upload dirs for this user that have not been touched in over 24 hours.
24async function cleanStaleUploads(userUploadDir: string): Promise<void> {

Callers 1

postFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected