Check-in [f31f4f56c6]
Overview
Comment:Updated to supply valid linked list for children and added readdir implementation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f31f4f56c6085b35acd2ae73b7b492cc3501ba0c
User & Date: rkeene on 2014-09-09 03:51:31
Other Links: manifest | tags
Context
2014-09-09
06:01
Updated with basic functionality check-in: f66a795908 user: rkeene tags: trunk
03:51
Updated to supply valid linked list for children and added readdir implementation check-in: f31f4f56c6 user: rkeene tags: trunk
03:43
More work on getting children processed check-in: b437874cfb user: rkeene tags: trunk
Changes

Modified appfs.c from [0c5019ef32] to [190e7becb3].

341
342
343
344
345
346
347

348
349
350

351
352
353
354
355
356
357
	if (_path[1] == '\0') {
		/* Request for the root directory */
		pathinfo->type = APPFS_PATHTYPE_DIRECTORY;
		sites = appfs_getsites(&sites_count);
		pathinfo->typeinfo.dir.childcount = sites_count;

		if (children) {

			for (site = sites; site; site = site->_next) {
				node = (void *) ckalloc(sizeof(*node));
				node->_next = *children;

				*children = node;
			}
		}

		appfs_free_list_site(sites);

		return(0);







>



>







341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
	if (_path[1] == '\0') {
		/* Request for the root directory */
		pathinfo->type = APPFS_PATHTYPE_DIRECTORY;
		sites = appfs_getsites(&sites_count);
		pathinfo->typeinfo.dir.childcount = sites_count;

		if (children) {
			*children = NULL;
			for (site = sites; site; site = site->_next) {
				node = (void *) ckalloc(sizeof(*node));
				node->_next = *children;
				strcpy(node->name, site->name);
				*children = node;
			}
		}

		appfs_free_list_site(sites);

		return(0);
401
402
403
404
405
406
407




408





409
410
411






412
413
414
415
416
417
418
		stbuf->st_size = pathinfo.typeinfo.file.size;
	}

	return res;
}

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




	APPFS_DEBUG("Enter (path = %s, ...)", path);






	filler(buf, ".", NULL, 0);
	filler(buf, "..", NULL, 0);







	return 0;
}

static int appfs_fuse_open(const char *path, struct fuse_file_info *fi) {
	return(-ENOENT);
}







>
>
>
>

>
>
>
>
>



>
>
>
>
>
>







403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
		stbuf->st_size = pathinfo.typeinfo.file.size;
	}

	return res;
}

static int appfs_fuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) {
	struct appfs_pathinfo pathinfo;
	struct appfs_children *children, *child;
	int res;

	APPFS_DEBUG("Enter (path = %s, ...)", path);

	res = appfs_get_path_info(path, &pathinfo, &children);
	if (res != 0) {
		return(res);
	}

	filler(buf, ".", NULL, 0);
	filler(buf, "..", NULL, 0);

	for (child = children; child; child = child->_next) {
		filler(buf, child->name, NULL, 0);
	}

	appfs_free_list_children(children);

	return 0;
}

static int appfs_fuse_open(const char *path, struct fuse_file_info *fi) {
	return(-ENOENT);
}