Initial commit

This commit is contained in:
Les De Ridder 2016-10-16 01:03:31 +02:00
commit 4aa24d6d76
No known key found for this signature in database
GPG Key ID: 5EC132DFA85DB372
7 changed files with 88 additions and 0 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.dub
docs.json
__dummy.html
*.o
*.obj
dtagfs

1
dfuse Submodule

@ -0,0 +1 @@
Subproject commit 8daf1d4fffbcd1415b963ed5a43fae5e4bf06464

6
dub.sdl Normal file
View File

@ -0,0 +1,6 @@
name "dtagfs"
description "A tag-based FUSE virtual file system"
authors "Les De Ridder"
copyright "Copyright © 2016, Les De Ridder"
license "NCSA"
dependency "dfuse" version="~>0.3.0"

6
dub.selections.json Normal file
View File

@ -0,0 +1,6 @@
{
"fileVersion": 1,
"versions": {
"dfuse": {"path":"dfuse"}
}
}

50
source/app.d Normal file
View File

@ -0,0 +1,50 @@
module dtagfs.app;
import std.stdio;
import std.getopt;
import std.array;
import dfuse.fuse;
import dtagfs.filesystem;
import dtagfs.tagprovider;
void main(string[] args)
{
//TODO: Make tag provider(s) configurable
if(args.length < 2)
{
stderr.writeln("usage: dtagfs <source> <mount point> [-f] [-o option[,options...]]");
return;
}
auto source = args[0];
auto mountPoint = args[1];
TagProvider[] tagProviders;
string[] mountOptions;
bool fork;
arraySep = ",";
auto otherArgs = args[2..$];
auto options = getopt(
otherArgs,
"o", &mountOptions,
"f|fork", &fork
);
auto filesystem = mount(source, mountPoint, tagProviders, mountOptions, fork);
}
FileSystem mount(string source, string mountPoint, TagProvider[] tagProviders, string[] options, bool fork)
{
auto filesystem = new FileSystem(source, tagProviders);
auto fuse = new Fuse("dtagfs", !fork, false);
fuse.mount(filesystem, mountPoint, options);
return filesystem;
}

13
source/filesystem.d Normal file
View File

@ -0,0 +1,13 @@
module dtagfs.filesystem;
import dfuse.fuse;
import dtagfs.tagprovider;
class FileSystem : Operations
{
this(string source, TagProvider[] tagProviders)
{
}
}

6
source/tagprovider.d Normal file
View File

@ -0,0 +1,6 @@
module dtagfs.tagprovider;
class TagProvider
{
}