-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.j2
28 lines (23 loc) · 964 Bytes
/
common.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
awk_fuse_parser: &awk_fuse_parser |
awk '
function execfuse_entity(path) {
return sprintf("ino=1 mode=drwxr-xr-x nlink=1 uid=0 gid=0 rdev=0 size=1024 blksize=512 blocks=2 atime=0 mtime=0 ctime=0 %s\n", path)
}
BEGIN {
printf("%s", execfuse_entity("."))
printf("%s", execfuse_entity(".."))
}
{
printf("%s", execfuse_entity($0))
}' | xargs -I{} sh -c "printf '{}\0'"
printf_parser: &printf_parser
xargs -I{} sh -c "printf 'ino=1 mode=drwxr-xr-x nlink=4 uid=0 gid=0 rdev=0 size=1224 blksize=512 blocks=2 atime=0 mtime=0 ctime=0 {}\0'"
handler_parser: *awk_fuse_parser
dir: &dir echo 'ino=1 mode=drwxr-xr-x nlink=1 uid=0 gid=0 rdev=0 size=0 blksize=512 blocks=2 atime=0 mtime=0 ctime=0 '
file: &file echo 'ino=1 mode=-rwxr-xr-x nlink=1 uid=0 gid=0 rdev=0 size=0 blksize=512 blocks=2 atime=0 mtime=0 ctime=0 '
is_dir: &is_dir
getattr:
sh: *dir
is_file: &is_file
getattr:
sh: *file