diff --git a/README.md b/README.md index c279d87..00f919a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ class MyFS : Operations } ``` -A minimal filesystem implements `Operations.getattr()`, `Operations.readdir()`, `Operations.read()`. See [dfuse/fuse.d](https://github.com/facebook/dfuse/blob/master/dfuse/fuse.d) for implementation specific details. +A minimal filesystem implements `Operations.getattr()`, `Operations.readdir()`, `Operations.read()`. See [dfuse/fuse.d](https://github.com/facebook/dfuse/blob/master/source/dfuse/fuse.d) for implementation specific details. To mount a filesystem use a Fuse object and call mount: ```D diff --git a/dub.json b/dub.json index 4915c90..4287297 100644 --- a/dub.json +++ b/dub.json @@ -7,14 +7,14 @@ "license": "BSL-1.0", "dependencies": {}, "configurations": [{ - "name": "dfuse", - "targetType": "library", - "platforms": ["osx"], - "libs": ["osxfuse_i32"] - }, { - "name": "dfuse", + "name": "dfuse-linux", "targetType": "library", "platforms": ["linux"], "libs": ["fuse"] + }, { + "name": "dfuse-osx", + "targetType": "library", + "platforms": ["osx"], + "libs": ["osxfuse_i32"] }] } diff --git a/source/c/fuse/common.d b/source/c/fuse/common.d index 920af35..dcb945d 100644 --- a/source/c/fuse/common.d +++ b/source/c/fuse/common.d @@ -63,7 +63,7 @@ extern (System) { /** * For future use. */ - uint reserved[23]; + uint[23] reserved; } static assert(fuse_file_info.sizeof == 64); diff --git a/source/dfuse/fuse.d b/source/dfuse/fuse.d index 8048b03..c891f24 100644 --- a/source/dfuse/fuse.d +++ b/source/dfuse/fuse.d @@ -17,8 +17,10 @@ import std.array; import std.conv; import std.stdio; import std.string; +import std.process; import errno = core.stdc.errno; import core.stdc.string; +import core.sys.posix.signal; import c.fuse.fuse; @@ -320,6 +322,7 @@ private: bool foreground; bool threaded; string fsname; + int pid; public: this(string fsname) @@ -381,6 +384,12 @@ public: enforce(length == cargs.length); } + this.pid = thisProcessID(); fuse_main(length, cast(char**) cargs.ptr, &fops, &ops); } + + void exit() + { + kill(this.pid, SIGINT); + } }