Added 'created' attribute to files and pages

This commit is contained in:
Zef Hemel
2023-11-03 09:38:04 +01:00
parent 3f1aa45b5d
commit 509683c537
16 changed files with 39 additions and 2 deletions
+3
View File
@@ -34,6 +34,7 @@ export default function fileSystemSyscalls(root = "/"): SysCallMapping {
const s = await Deno.stat(p);
return {
name: filePath,
created: s.birthtime!.getTime(),
lastModified: s.mtime!.getTime(),
contentType: mime.getType(filePath) || "application/octet-stream",
size: s.size,
@@ -56,6 +57,7 @@ export default function fileSystemSyscalls(root = "/"): SysCallMapping {
const s = await Deno.stat(p);
return {
name: filePath,
created: s.birthtime!.getTime(),
lastModified: s.mtime!.getTime(),
contentType: mime.getType(filePath) || "application/octet-stream",
size: s.size,
@@ -84,6 +86,7 @@ export default function fileSystemSyscalls(root = "/"): SysCallMapping {
const s = await Deno.stat(fullPath);
allFiles.push({
name: fullPath.substring(dirPath.length + 1),
created: s.birthtime!.getTime(),
lastModified: s.mtime!.getTime(),
contentType: mime.getType(fullPath) || "application/octet-stream",
size: s.size,