Exemplo n.º 1
0
static fssh_status_t
move_entry(int dir, const char *entry, int targetDir, const char* target,
	bool force)
{
	// stat the file
	struct fssh_stat st;
	fssh_status_t status = _kern_read_stat(dir, entry, false, &st, sizeof(st));
	if (status != FSSH_B_OK) {
		if (force && status == FSSH_B_ENTRY_NOT_FOUND)
			return FSSH_B_OK;

		fprintf(stderr, "Error: Failed to move \"%s\": %s\n", entry,
			fssh_strerror(status));
		return status;
	}

	return _kern_rename(dir, entry, targetDir, target);
}
Exemplo n.º 2
0
static int
fuse_rename(const char* from, const char* to)
{
	PRINTD("##rename\n");
	return _ERR(_kern_rename(-1, from, -1, to));
}