--- s3fs.cpp.orig 2010-02-05 03:45:59.000000000 +0300 +++ s3fs.cpp 2010-05-14 20:51:44.000000000 +0400 @@ -345,7 +345,7 @@ static string AWSAccessKeyId; static string AWSSecretAccessKey; static string host = "http://s3.amazonaws.com"; -static mode_t root_mode = 0; +static struct stat root_stat; static string service_path = "/"; // if .size()==0 then local file cache is disabled @@ -807,8 +807,7 @@ cout << "getattr[path=" << path << "]" << endl; memset(stbuf, 0, sizeof(struct stat)); if (strcmp(path, "/") == 0) { - stbuf->st_nlink = 1; // see fuse faq - stbuf->st_mode = root_mode | S_IFDIR; + *stbuf = root_stat; return 0; } @@ -1278,6 +1277,10 @@ s3fs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) { //cout << "readdir:"<< " path="<< path << endl; + // add .. and . + filler(buf, ".", NULL, 0); + filler(buf, "..", NULL, 0); + string NextMarker; string IsTruncated("true"); @@ -1593,7 +1596,7 @@ struct stat buf; // its the mountpoint... what is its mode? if (stat(arg, &buf) != -1) { - root_mode = buf.st_mode; + root_stat = buf; } } }