37 lines
709 B
Plaintext
37 lines
709 B
Plaintext
|
#!/bin/sh
|
||
|
LOG=~/.fuse.log
|
||
|
|
||
|
file1="hello world"
|
||
|
|
||
|
echo "$0 $*" >> $LOG
|
||
|
{
|
||
|
case "$1" in
|
||
|
readdir)
|
||
|
echo "file1"
|
||
|
;;
|
||
|
getattr)
|
||
|
# format: mode nlink uid gid size block
|
||
|
case "$2" in
|
||
|
/)
|
||
|
echo "16877 2 1000 1000 4096 8" && exit 0 # dir (mode 0755)
|
||
|
;;
|
||
|
/file1)
|
||
|
echo "33188 1 1000 1000 ${#file1} 1" && exit 0 # file (mode 0644, size 6)
|
||
|
;;
|
||
|
esac
|
||
|
exit 1
|
||
|
;;
|
||
|
read)
|
||
|
case "$2" in
|
||
|
/file1)
|
||
|
echo "$file1"
|
||
|
;;
|
||
|
esac
|
||
|
;;
|
||
|
*)
|
||
|
exit 1
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
} | tee -a $LOG
|