aboutsummaryrefslogtreecommitdiff
path: root/src/ext/readdir.c
blob: 4e3692480ad9de04087eceefce2a3791c3fb31a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * reddir.c - FUSE read directory function
 *
 *  Created on: Mar 14, 2012
 *      Author: mg
 *
 * Read directory
 *
 * This supersedes the old getdir() interface.  New applications
 * should use this.
 *
 * The filesystem may choose between two modes of operation:
 *
 * 1) The readdir implementation ignores the offset parameter, and
 * passes zero to the filler function's offset.  The filler
 * function will not return '1' (unless an error happens), so the
 * whole directory is read in a single readdir operation.  This
 * works just like the old getdir() method.
 *
 * 2) The readdir implementation keeps track of the offsets of the
 * directory entries.  It uses the offset parameter and always
 * passes non-zero offset to the filler function.  When the buffer
 * is full (or an error happens) the filler function will return
 * '1'.
 *
 * Introduced in version 2.3
 */

#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
//#include <string.h>
//#include <errno.h>
//#include <glib.h>
#include <fuse.h>
//#include <GNUnet/gnunet_ecrs_lib.h>
#include <gnunet-fuse.h>





int gn_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
	off_t offset, struct fuse_file_info *fi)
{

	//char* track = "mal";
	//char  var[strlen(directory)+strlen(track)+1];
	//memcpy(var,directory,strlen(directory));
	//int len = strlen(directory);
// GNUNET_asprintf();


		filler(buf, ".", NULL, 0);
		filler(buf, "..", NULL, 0);
	//filler(buf, "/home/mg/gnunet-fuse2/gnunet-fuse/src/ext/monti"+1, NULL, 0);
		//return 0;




}