MCPcopy Index your code
hub / github.com/coder/coder / readFileInfo

Method readFileInfo

site/src/utils/tar.ts:70–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 }
69
70 private readFileInfo() {
71 this.fileInfo = [];
72 let offset = 0;
73
74 while (offset < this.buffer.byteLength - 512) {
75 const fileName = this.readFileName(offset);
76 if (!fileName) {
77 break;
78 }
79 const fileType = this.readFileType(offset);
80 const fileSize = this.readFileSize(offset);
81 const fileMode = this.readFileMode(offset);
82 const fileMtime = this.readFileMtime(offset);
83 const fileUser = this.readFileUser(offset);
84 const fileGroup = this.readFileGroup(offset);
85
86 this.fileInfo.push({
87 name: fileName,
88 type: fileType,
89 size: fileSize,
90 headerOffset: offset,
91 mode: fileMode,
92 mtime: fileMtime,
93 user: fileUser,
94 group: fileGroup,
95 });
96
97 offset += 512 + 512 * Math.floor((fileSize + 511) / 512);
98 }
99 }
100
101 private readString(offset: number, maxSize: number) {
102 let size = 0;

Callers 1

readFileMethod · 0.95

Calls 8

readFileNameMethod · 0.95
readFileTypeMethod · 0.95
readFileSizeMethod · 0.95
readFileModeMethod · 0.95
readFileMtimeMethod · 0.95
readFileUserMethod · 0.95
readFileGroupMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected