Exemplo n.º 1
0
static int volicon_rename(const char *from, const char *to)
{
    ERROR_IF_MAGIC_FILE(from, EACCES);
    ERROR_IF_MAGIC_FILE(to, EACCES);

    return fuse_fs_rename(volicon_get()->next, from, to);
}
Exemplo n.º 2
0
static int subdir_rename(const char *from, const char *to)
{
	struct subdir *d = subdir_get();
	char *newfrom;
	char *newto;
	int err = subdir_addpath(d, from, &newfrom);
	if (!err) {
		err = subdir_addpath(d, to, &newto);
		if (!err) {
			err = fuse_fs_rename(d->next, newfrom, newto);
			free(newto);
		}
		free(newfrom);
	}
	return err;
}
Exemplo n.º 3
0
static int iconv_rename(const char *from, const char *to)
{
	struct iconv *ic = iconv_get();
	char *newfrom;
	char *newto;
	int err = iconv_convpath(ic, from, &newfrom, 0);
	if (!err) {
		err = iconv_convpath(ic, to, &newto, 0);
		if (!err) {
			err = fuse_fs_rename(ic->next, newfrom, newto);
			free(newto);
		}
		free(newfrom);
	}
	return err;
}