Initial project import
This commit is contained in:
commit
23f2d29e32
11957 files changed
+1754577
No files matched your search
@@ -0,0 +1,28 @@
|
||||
module file
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
pub struct Entity {
|
||||
os.FileInfo
|
||||
path string
|
||||
mod_time time.Time
|
||||
url string
|
||||
fname string
|
||||
}
|
||||
|
||||
fn path_to_entity(path string, uri_path string) Entity {
|
||||
pinfo := os.inode(path)
|
||||
mut uri_base := ''
|
||||
if uri_path.len > 0 {
|
||||
uri_base = '/${uri_path}'
|
||||
}
|
||||
fname := os.file_name(path)
|
||||
return Entity{
|
||||
FileInfo: pinfo
|
||||
path: path
|
||||
mod_time: time.unix(pinfo.mtime)
|
||||
url: '${uri_base}/${fname}'
|
||||
fname: fname
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user