Skip to content

Commit

Permalink
Removing directory support -- Directories are no longer supported as …
Browse files Browse the repository at this point in the history
…GridFS uses a db-per-namespace instead of nested directory support. For our usage, this is much more friendly that creating a directory by default anytime our files don't have periods in them.
  • Loading branch information
root committed Jul 29, 2011
1 parent b27ee7f commit 3399450
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ int gridfs_getattr(const char *path, struct stat *stbuf)

// HACK: Assumes that if the last part of the path has a '.' in it, it's the leaf of the path, and if we haven't found a match by now,
// give up and go home. This works just dandy as long as you avoid putting periods in your 'directory' names.
if(!is_leaf(path)) {
/*if(!is_leaf(path)) {
stbuf->st_mode = S_IFDIR | 0777;
stbuf->st_nlink = 2;
return 0;
}
}*/

ScopedDbConnection sdc(gridfs_options.host);
GridFS gf(sdc.conn(), gridfs_options.db);
Expand Down Expand Up @@ -441,3 +441,9 @@ int gridfs_rename(const char* old_path, const char* new_path)

return 0;
}

int gridfs_mknod(const char *path, mode_t mode, dev_t rdev)
{

fprintf(stderr, "MKNOD: %s\n", path);
}
4 changes: 4 additions & 0 deletions options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ struct fuse_opt gridfs_opts[] =
{
GRIDFS_OPT_KEY("--host=%s", host, 0),
GRIDFS_OPT_KEY("--db=%s", db, 0),
GRIDFS_OPT_KEY("--username=%s", username, 0),
GRIDFS_OPT_KEY("--password=%s", password, 0),
FUSE_OPT_KEY("-v", KEY_VERSION),
FUSE_OPT_KEY("--version", KEY_VERSION),
FUSE_OPT_KEY("-h", KEY_HELP),
Expand Down Expand Up @@ -55,6 +57,8 @@ void print_help()
cout << endl << "general options:" << endl;
cout << "\t--db=[dbname]\t\twhich mongo database to use" << endl;
cout << "\t--host=[hostname]\thostname of your mongodb server" << endl;
cout << "\t--username=[username]\tusername of your mongodb server" << endl;
cout << "\t--password=[password]\tpassword of your mongodb server" << endl;
cout << "\t-h, --help\t\tprint help" << endl;
cout << "\t-v, --version\t\tprint version" << endl;
cout << endl << "FUSE options: " << endl;
Expand Down

0 comments on commit 3399450

Please sign in to comment.