{"id":8784,"date":"2015-12-08T09:00:20","date_gmt":"2015-12-08T00:00:20","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=8784"},"modified":"2018-11-14T16:33:47","modified_gmt":"2018-11-14T07:33:47","slug":"fuse-%e3%81%a7%e3%82%aa%e3%83%ac%e3%82%aa%e3%83%ac%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f-haskell-%e3%81%a7","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2015\/12\/08\/fuse-%e3%81%a7%e3%82%aa%e3%83%ac%e3%82%aa%e3%83%ac%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f-haskell-%e3%81%a7\/","title":{"rendered":"fuse \u3067\u30aa\u30ec\u30aa\u30ec\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u3063\u3066\u307f\u305f (Haskell \u3067)"},"content":{"rendered":"
TECHSCORE Advent Calendar 2015<\/a> \u306e 8 \u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n Unix \u7cfb OS \u3067\u306f\u3001fuse<\/a> \u3068\u3044\u3046\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u3001\u30aa\u30ec\u30aa\u30ec\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u4eca\u56de\u306f\u3001fuse \u3068 locate \u30b3\u30de\u30f3\u30c9\u3067\u4f5c\u3063\u3066\u307f\u305f\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u30cd\u30bf\u306b\u3001\u3069\u3093\u306a\u611f\u3058\u3067\u958b\u767a\u3067\u304d\u308b\u304b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n \u3053\u306e\u5185\u5bb9\u306b\u8208\u5473\u306e\u306a\u3044\u65b9\u306f\u3001\u6700\u5f8c\u306e\u4e16\u754c\u3067\u4e00\u756a\u304b\u308f\u3044\u3044\u732b\u306e\u753b\u50cf\u3092\u597d\u304d\u306a\u3060\u3051\u773a\u3081\u3066\u3044\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n GUI \u306e\u30d5\u30a1\u30a4\u30e9\u30fc\u3067\u306f\u3001\u691c\u7d22\u3092\u3059\u308b\u3068\u7d50\u679c\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u305a\u3089\u305a\u3089\u3068\u51fa\u3066\u304d\u3066\u901a\u5e38\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u540c\u3058\u3088\u3046\u306a\u64cd\u4f5c\u304c\u3067\u304d\u308b\u3001\u305d\u3046\u3044\u3063\u305f\u3082\u306e\u304c\u3088\u304f\u3042\u308a\u307e\u3059\u3002 \u3057\u304b\u3057\u3001locate \u306a\u3069\u3067\u691c\u7d22\u3057\u3066\u3082\u3001\u5358\u306b\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u304c\u8868\u793a\u3055\u308c\u308b\u3060\u3051\u3067\u3059\u3002 \u305d\u3053\u3067\u3001(\u95b2\u89a7\u3060\u3051\u306b\u306a\u308a\u307e\u3059\u304c)\u4f3c\u305f\u3088\u3046\u306a\u3053\u3068\u3092\u3059\u308b\u305f\u3081\u306b\u3001locate \u30b3\u30de\u30f3\u30c9\u306e\u7d50\u679c\u3092\u901a\u5e38\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u3088\u3046\u306b\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306a\u3069\u3092 CLI \u306e\u30d5\u30a1\u30a4\u30e9\u30fc\u306e ranger<\/a> \u306a\u3069\u3067\u3001\u3053\u3093\u306a\u611f\u3058\u2193\u3067\u6b21\u3005\u306b\u898b\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u4e3b\u306a\u76ee\u7684\u3067\u3059\u3002<\/p>\n (systemd \u306e service \u30d5\u30a1\u30a4\u30eb\u691c\u7d22\u3057\u3066\u898b\u3066\u3044\u307e\u3059)<\/p>\n \u30a2\u30af\u30bb\u30b9\u3059\u308b\u30d1\u30b9\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3092 locate \u306b\u6e21\u3059\u30af\u30a8\u30ea\u3068\u3057\u3066\u3001\u305d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068 locate \u306e\u691c\u7d22\u7d50\u679c\u304c\u51fa\u308b\u3068\u3044\u3046\u4ed5\u7d44\u307f\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n \/locate \u304c\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u30de\u30a6\u30f3\u30c8\u5148\u3067\u3001pacman.log \u3092\u691c\u7d22\u3057\u305f\u3044\u3068\u3057\u307e\u3059\u3002 \u3053\u306e\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u69d8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n \/locate\/pacman.log\/<\/strong> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b var_-log_-pacman.log<\/strong> \u306a\u3069\u306e\u30a8\u30f3\u30c8\u30ea\u304c\u5b58\u5728\u3059\u308b\u3088\u3046\u306b\u898b\u3048\u308b\u5bf8\u6cd5\u3067\u3059\u3002 \u3061\u306a\u307f\u306b\u3001\u30a8\u30f3\u30c8\u30ea\u540d\u306f\u30d5\u30eb\u30d1\u30b9\u306e\u30b9\u30e9\u30c3\u30b7\u30e5\u3092 _- \u3068\u3044\u3063\u305f\u98a8\u306b\u9069\u5f53\u306b\u52a0\u5de5\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \u30c7\u30b3\u30fc\u30c9\u3059\u308b\u3053\u3068\u3067\u3001\u30d5\u30eb\u30d1\u30b9\u304c\u5f97\u3089\u308c\u308b\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u3002<\/p>\n \u3053\u308c\u3089\u306e\u30a8\u30f3\u30c8\u30ea\u306f\u3001\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u306a\u306e\u3067\u3001\u3053\u306e\u30ea\u30f3\u30af\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u3067\u3001\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u306a\u3069\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002<\/p>\n \u3053\u3046\u3084\u3063\u3066\u30d1\u30b9\u3092\u6253\u3061\u8fbc\u3080\u5206\u306b\u306f\u7279\u306b\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4e0a\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u69d8\u306a\u30d5\u30a1\u30a4\u30e9\u30fc\u3067\u306f\u3001\u3061\u3087\u3063\u3068\u4fbf\u5229\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u3002<\/p>\n fuse \u3067\u306e\u5b9f\u88c5\u306f\u3001\u7c21\u5358\u3067\u3059\u3002 \u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u4e0a\u306e\u6a5f\u80fd(\u30d5\u30a1\u30a4\u30eb\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u8aad\u307f\u8fbc\u307f\u7b49\u3005)\u3092\u3001\u95a2\u6570\u3092\u66f8\u304f\u3053\u3068\u3067\u5b9f\u88c5\u3057\u3066\u3044\u304f\u3060\u3051\u3067\u3059\u3002 \u4e0d\u8981\u306a\u6a5f\u80fd\u306b\u3064\u3044\u3066\u306f\u3001\u305d\u306e\u6a5f\u80fd\u306f\u7121\u3044\u3068\u8fd4\u3059\u3060\u3051\u3067\u826f\u3044\u306e\u3067\u3001\u5b9f\u8cea\u7701\u7565\u3067\u304d\u307e\u3059\u3002<\/p>\n \u307e\u305f\u3001\u8272\u3005\u306a\u8a00\u8a9e\u306e\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0<\/a> \u3082\u3042\u308b\u306e\u3067\u3001\u5927\u62b5\u306e\u8a00\u8a9e\u3067\u5bb9\u6613\u306b\u5b9f\u88c5\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n \u305d\u3046\u3044\u3046\u308f\u3051\u3067(?)\u3001\u4eca\u56de\u306f Haskell \u3067\u5b9f\u88c5\u3057\u307e\u3057\u305f\u3002<\/p>\n \u5b9f\u969b\u306b\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3092\u629c\u7c8b\u3057\u3064\u3064\u3001\u8efd\u304f\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u306e\u60c5\u5831\u3092\u751f\u6210\u3057\u307e\u3059\u3002 \u30ea\u30f3\u30af\u306e\u307b\u3046\u306f\u3001getFileStatus \u3067\u30ea\u30f3\u30af\u5143\u30d5\u30a1\u30a4\u30eb\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u3001\u8ee2\u8a18\u3057\u3066\u3044\u307e\u3059\u3002 \u5f8c\u8ff0\u306e\u95a2\u6570\u3067\u3001\u3053\u308c\u3089\u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n FuseOperations \u304c\u3001\u8981\u3068\u306a\u308b\u30c7\u30fc\u30bf\u578b\u3067\u3059\u3002 fuseGetFileStat \u306a\u3069\u304c\u5404\u6a5f\u80fd\u3067\u3001\u3053\u308c\u3089\u81ea\u524d\u306e\u95a2\u6570\u3092\u30d0\u30a4\u30f3\u30c9\u3057\u3066\u3084\u308a\u307e\u3059\u3002 (\u5f15\u6570\u306e Semaphore \u3068 Cache \u306f locate \u7d50\u679c\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u95a2\u3059\u308b\u3082\u306e\u3067\u3001fuse \u3068\u76f4\u63a5\u95a2\u4fc2\u306f\u3042\u308a\u307e\u305b\u3093)<\/p>\n \u3042\u3068\u306f\u3001\u305d\u308c\u305e\u308c\u306e\u6a5f\u80fd\u3092\u500b\u5225\u306b\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3059\u3002 lfs\u301c\u3068\u3044\u3046\u306e\u304c\u305d\u308c\u3067\u3059\u3002<\/p>\n locate \u7d50\u679c\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\u3057\u306b\u6765\u305f\u3068\u304d\u3060\u3051\u3001\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u306e\u60c5\u5831\u3092\u751f\u6210\u3057\u3066\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002 \u4ed6\u306f\u3001\u56fa\u5b9a\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u60c5\u5831\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n procPath \u306f\u3001\u5f15\u6570\u306e\u30d1\u30b9\u304c \u30eb\u30fc\u30c8\/\u30af\u30a8\u30ea\/\u7d50\u679c\u306e\u30d1\u30b9 \u304b\u3067\u51e6\u7406\u3092\u5206\u3051\u308b\u95a2\u6570\u3067\u3059\u3002<\/p>\n \u672c\u6765\u3067\u3042\u308c\u3070\u3001\u30d1\u30b9\u3092\u898b\u3066\u5224\u65ad\u3059\u308b\u306e\u3067\u3057\u3087\u3046\u304c\u3001\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u63d0\u4f9b\u3057\u306a\u3044\u306e\u3067\u3001\u7121\u6761\u4ef6\u3067\u6210\u529f\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3092\u30af\u30a8\u30ea\u3068\u3057\u3066 locate \u3092\u5b9f\u884c\u3057\u3001\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3068\u3057\u3066\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002 \"\/\" \u306a\u3069\u306e\u30a2\u30af\u30bb\u30b9\u6642\u306f\u3001\u3068\u308a\u3042\u3048\u305a\u5931\u6557(\u5b58\u5728\u3057\u306a\u3044 = eNOENT)\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n \u8981\u3059\u308b\u306b readlink \u3059\u308b\u3082\u306e\u3067\u3059\u3002 \u6307\u5b9a\u306e\u30d1\u30b9\u306e\u30ea\u30f3\u30af\u306e\u30ea\u30f3\u30af\u5148\u3092\u8fd4\u3057\u307e\u3059\u3002 locate \u7d50\u679c\u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u306e\u30ea\u30f3\u30af\u5148\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3082\u3001\u30ea\u30f3\u30af\u3067\u306a\u3044\u306f\u305a\u306e\u30d1\u30b9\u306b\u3064\u3044\u3066\u306f\u3001\u5931\u6557\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n fixString \u306f\u3001\u30ea\u30f3\u30af\u5148\u306e\u30d1\u30b9\u306b\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u304c\u5165\u3063\u3066\u3044\u308b\u3068\u6587\u5b57\u5316\u3051\u3059\u308b\u3068\u3044\u3046\u554f\u984c(\u30d0\u30b0?)\u3078\u306e workaround \u3067\u3059\u3002 \u672c\u6765\u306f\u5fc5\u8981\u306a\u3044\u306e\u3060\u3068\u601d\u3044\u307e\u3059\u3002 \u5f8c\u3067\u3061\u3083\u3093\u3068\u8abf\u3079\u305f\u3044\u3067\u3059\u306d\u3002<\/p>\n \u3068\u308a\u3042\u3048\u305a\u3001\u30b5\u30f3\u30d7\u30eb\u3068\u540c\u3058\u5024\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002 \u30d5\u30a1\u30a4\u30eb\u540d\u304c\u9577\u304f\u306a\u308a\u304c\u3061\u306a\u306e\u3067\u3001fsStatMaxNameLength \u3060\u3051\u3001\u9577\u3081\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n \u5168\u4f53\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u3001\u3053\u3061\u3089 (github.com)<\/a> \u306b\u7528\u610f\u3057\u307e\u3057\u305f\u3002 fuse \u306e\u958b\u767a\u7528\u30d1\u30c3\u30b1\u30fc\u30b8\u3001haskell \u306e\u30b3\u30f3\u30d1\u30a4\u30e9\u306e ghc \u3068 cabal \u304c\u3042\u308c\u3070\u3001make \u4e00\u767a\u3067\u30d3\u30eb\u30c9\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002 (cabal sandbox \u4e0a\u3067\u30d3\u30eb\u30c9\u3057\u307e\u3059)<\/p>\n \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u30de\u30a6\u30f3\u30c8\u5148\u3092\u6e21\u3057\u3066\u3084\u308c\u3070\u3001\u305d\u308c\u3060\u3051\u3067\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u52d5\u4f5c\u3057\u307e\u3059\u3002 \u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u306f\u3001 dist\/build\/locatefs\/locatefs \u306b\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n \u306a\u305c\u304b\u5076\u306b Segfault \u3067\u843d\u3061\u305f\u308a\u3001\u5999\u306a\u3053\u3068\u306b\u306a\u308b\u3088\u3046\u3067\u3059\u3002 \u306a\u306b\u304b\u3054\u5b58\u77e5\u306e\u304b\u305f\u304c\u3044\u307e\u3057\u305f\u3089\u3001\u305c\u3072\u5fa1\u6559\u793a\u304f\u3060\u3055\u3044! \u6761\u4ef6\u3082\u307e\u3060\u308f\u304b\u3089\u305a\u3001\u8b0e\u3067\u3059\u3002<\/p>\n \u307e\u305f\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u30a8\u30b9\u30b1\u30fc\u30d7\u65b9\u6cd5\u3082\u3001\u3082\u3046\u5c11\u3057\u898b\u3084\u3059\u3044\u3082\u306e\u306b\u3057\u305f\u3044\u3067\u3059\u306d\u3002<\/p>\n \u3055\u3066\u3001\u3053\u3053\u307e\u3067\u8aad\u3093\u3067\u304f\u308c\u3066\u304a\u75b2\u308c\u3055\u307e\u3067\u3057\u305f\u3002 \u3042\u3068\u306f\u3001\u4e16\u754c\u3067\u4e00\u756a\u304b\u308f\u3044\u3044\u30a6\u30c1\u306e\u732b\u306e\u5199\u771f\u3092\u304a\u697d\u3057\u307f\u304f\u3060\u3055\u3044\u3002<\/p>\n TECHSCORE Advent Calendar 2015 \u306e 8 \u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002fuse \u3067\u30aa\u30ec\u30aa\u30ec\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u3063\u3066\u307f\u305f<\/h1>\n
\u691c\u7d22\u7528\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0<\/h1>\n
<\/div>\n
\u4ed5\u7d44\u307f<\/h1>\n
\u5177\u4f53\u4f8b<\/h2>\n
$ ls \/locate\/pacman.log\/\r\nhome_-maomao_-.neocomplcache_-buffer__cache_-=+var=+log=+pacman.log\r\nhome_-maomao_-.neocomplcache_-keyword__patterns_-=+var=+log=+pacman.log\r\nvar_-log_-pacman.log<\/code><\/pre>\n
$ head \/locate\/pacman.log\/var_-log_-pacman.log\r\n[2011-11-01 06:16] installed filesystem (2011.08-1)\r\n[2011-11-01 06:16] installed util-linux (2.19.1-3)\r\n[2011-11-01 06:16] installed libusb (1.0.8-1)\r\n[2011-11-01 06:16] installed libusb-compat (0.1.3-1)\r\n[2011-11-01 06:16] installed pcre (8.13-1)\r\n[2011-11-01 06:16] installed glib2 (2.28.8-1)\r\n[2011-11-01 06:16] installed module-init-tools (3.16-1)\r\n[2011-11-01 06:16] installed pciutils (3.1.7-4)\r\n[2011-11-01 06:16] installed udev (173-3)\r\n[2011-11-01 06:16] installed device-mapper (2.02.87-1)<\/code><\/pre>\n
\u3069\u3046\u5b9f\u88c5\u3059\u308b\u304b<\/h1>\n
\u5b9f\u969b\u306e\u5b9f\u88c5<\/h1>\n
dirStat :: FuseContext -> FileStat\r\ndirStat ctx = FileStat { statEntryType = Directory\r\n , statFileMode = foldr1 unionFileModes modes\r\n , statLinkCount = 2\r\n , statFileOwner = fuseCtxUserID ctx\r\n , statFileGroup = fuseCtxGroupID ctx\r\n , statSpecialDeviceID = 0\r\n , statFileSize = 4096\r\n , statBlocks = 1\r\n , statAccessTime = 0\r\n , statModificationTime = 0\r\n , statStatusChangeTime = 0 }\r\n where\r\n modes = [ownerReadMode, groupReadMode]\r\n\r\n\r\nlinkStat :: FilePath -> IO FileStat\r\nlinkStat path = stat <$> getFileStatus path\r\n where\r\n stat status = FileStat { statEntryType = SymbolicLink\r\n , statFileMode = fileMode status\r\n , statLinkCount = linkCount status\r\n , statFileOwner = fileOwner status\r\n , statFileGroup = fileGroup status\r\n , statSpecialDeviceID = specialDeviceID status\r\n , statFileSize = fileSize status\r\n , statBlocks = 1 -- fromIntegral (fileSize status `div` 1024)\r\n , statAccessTime = accessTime status\r\n , statModificationTime = modificationTime status\r\n , statStatusChangeTime = statusChangeTime status }<\/code><\/pre>\n
lfsOps :: Semaphore -> Cache -> FuseOperations Unit\r\nlfsOps sem cache = defaultFuseOps { fuseGetFileStat = lfsGetFileStat\r\n , fuseOpenDirectory = lfsOpenDirectory\r\n , fuseReadDirectory = lfsReadDirectory sem cache\r\n , fuseReadSymbolicLink = lfsReadSymbolicLink\r\n , fuseGetFileSystemStats = lfsGetFileSystemStats }<\/code><\/pre>\n
\u30d5\u30a1\u30a4\u30eb\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u6a5f\u80fd<\/h2>\n
lfsGetFileStat :: FilePath -> IO (Either Errno FileStat)\r\nlfsGetFileStat = procPath r (const r) qp . unescape\r\n where\r\n r = Right . dirStat <$> getFuseContext\r\n qp fp = do exist linkStat fp\r\n else return $ Left eNOENT<\/code><\/pre>\n
\u30c7\u30a3\u30ec\u30c8\u30af\u30ea\u3092\u958b\u304f\u3053\u3068\u304c\u51fa\u6765\u308b\u304b\u78ba\u8a8d\u3059\u308b\u6a5f\u80fd<\/h2>\n
lfsOpenDirectory :: FilePath -> IO Errno\r\nlfsOpenDirectory _ = return eOK<\/code><\/pre>\n
\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30a8\u30f3\u30c8\u30ea\u3092\u53d6\u5f97\u3059\u308b\u6a5f\u80fd<\/h2>\n
lfsReadDirectory :: Semaphore -> Cache -> FilePath -> IO (Either Errno [(FilePath, FileStat)])\r\nlfsReadDirectory sem cache = procPath r q qp\r\n where\r\n r = Right . dots <$> getFuseContext\r\n q query = do\r\n ctx forM ls entry\r\n qp _ = return $ Left eNOENT\r\n dots ctx = [(\".\", dirStat ctx), (\"..\", dirStat ctx)]\r\n entry path = (escape path,) <$> linkStat path<\/code><\/pre>\n
\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u306e\u89e3\u6c7a\u6a5f\u80fd<\/h2>\n
lfsReadSymbolicLink :: FilePath -> IO (Either Errno FilePath)\r\nlfsReadSymbolicLink = return . procPath r (const r) qp . unescape\r\n where\r\n r = Left eNOENT\r\n qp = Right . fixString<\/code><\/pre>\n
\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u60c5\u5831\u53d6\u5f97\u6a5f\u80fd<\/h2>\n
lfsGetFileSystemStats :: String -> IO (Either Errno FileSystemStats)\r\nlfsGetFileSystemStats _ =\r\n return $ Right $ FileSystemStats\r\n { fsStatBlockSize = 512\r\n , fsStatBlockCount = 1\r\n , fsStatBlocksFree = 1\r\n , fsStatBlocksAvailable = 1\r\n , fsStatFileCount = 5\r\n , fsStatFilesFree = 10\r\n , fsStatMaxNameLength = 4096 }<\/code><\/pre>\n
\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h1>\n
\u4f7f\u3044\u304b\u305f<\/h2>\n
$ .\/locatefs \/locate<\/code><\/pre>\n
\u554f\u984c\u70b9<\/h1>\n
\u4e16\u754c\u3067\u4e00\u756a\u304b\u308f\u3044\u3044\u732b<\/h1>\n
<\/div>\n","protected":false},"excerpt":{"rendered":"
\nfuse \u3067\u30aa\u30ec\u30aa\u30ec\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u3063\u3066\u307f\u305f
\nUnix \u7cfb OS \u3067\u306f\u3001fuse \u3068\u3044\u3046\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u3001\u30aa\u30ec\u30aa\u30ec\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002
\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":43,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[215,18],"tags":[141,212,99,213,211],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/8784"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=8784"}],"version-history":[{"count":24,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/8784\/revisions"}],"predecessor-version":[{"id":8848,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/8784\/revisions\/8848"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=8784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=8784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=8784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}