Beispiel #1
0
void *
spade_init(struct fuse_conn_info *conn) {
    FUSE_ENABLE_SETVOLNAME(conn);
    FUSE_ENABLE_XTIMES(conn);

    return NULL;
}
Beispiel #2
0
void *
loopback_init(struct fuse_conn_info *conn)
{
    FUSE_ENABLE_SETVOLNAME(conn);
    FUSE_ENABLE_XTIMES(conn);

#ifdef FUSE_ENABLE_CASE_INSENSITIVE
    if (loopback.case_insensitive) {
        FUSE_ENABLE_CASE_INSENSITIVE(conn);
    }
#endif

    return NULL;
}
Beispiel #3
0
void * FuseHFS_init(struct fuse_conn_info *conn) {
	struct fuse_context *cntx=fuse_get_context();
	struct fusehfs_options *options = cntx->private_data;
	
#if (__FreeBSD__ >= 10)
	FUSE_ENABLE_SETVOLNAME(conn); // this actually doesn't do anything
	FUSE_ENABLE_XTIMES(conn); // and apparently this doesn't either
#endif
	
	
#ifdef DEBUG
	//char logfn[128];
	//sprintf(logfn, "/fusefs_hfs/FuseHFS.%d.log", getpid());
	//stderr = freopen(logfn, "a", stderr);
    log_to_file();
	fprintf(stderr, "FuseHFS_init\n");
	fflush(stderr);
#endif
	
	// create iconv
	iconv_to_utf8 = iconv_open("UTF-8", options->encoding);
	if (iconv_to_utf8 == (iconv_t)-1) {
		perror("iconv_open");
		exit(1);
	}
	iconv_to_mac = iconv_open(options->encoding, "UTF-8");
	if (iconv_to_mac == (iconv_t)-1) {
		perror("iconv_open");
		exit(1);
	}
	
	// mount volume
	int mode = options->readonly?HFS_MODE_RDONLY:HFS_MODE_ANY;
	if (NULL == hfs_mount(options->path, 0, mode)) {
		perror("hfs_mount");
		exit(1);
	}
	
	// initialize some globals
	_readonly = options->readonly;
	hfsvolent vstat;
	hfs_vstat(NULL, &vstat);
	strcpy(_volname, vstat.name);
	
	return NULL;
}