Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

Build fixes and implement an exit method #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}]
}
2 changes: 1 addition & 1 deletion source/c/fuse/common.d
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extern (System) {
/**
* For future use.
*/
uint reserved[23];
uint[23] reserved;
}

static assert(fuse_file_info.sizeof == 64);
Expand Down
9 changes: 9 additions & 0 deletions source/dfuse/fuse.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -320,6 +322,7 @@ private:
bool foreground;
bool threaded;
string fsname;
int pid;

public:
this(string fsname)
Expand Down Expand Up @@ -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);
}
}