示例#1
0
文件: fs.c 项目: cantona/iphonelinux
void fs_cmd_ls(int argc, char** argv) {
	Volume* volume;
	io_func* io;

	if(argc < 2) {
		bufferPrintf("usage: %s <partition> <directory>\r\n", argv[0]);
		return;
	}

	io = bdev_open(parseNumber(argv[1]));
	if(io == NULL) {
		bufferPrintf("fs: cannot read partition!\r\n");
		return;
	}

	volume = openVolume(io);
	if(volume == NULL) {
		bufferPrintf("fs: cannot openHFS volume!\r\n");
		return;
	}

	if(argc > 2)
		hfs_ls(volume, argv[2]);
	else
		hfs_ls(volume, "/");

	closeVolume(volume);
	CLOSE(io);
}
示例#2
0
void fs_cmd_ls(int argc, char** argv) {
	if(argc < 2) {
		bufferPrintf("usage: %s <device> <partition> <directory>\r\n", argv[0]);
		return;
	}

	bdevfs_device_t *dev = bdevfs_open(parseNumber(argv[1]), parseNumber(argv[2]));
	if(!dev)
	{
		bufferPrintf("fs: Failed to open partition.\n");
		return;
	}

	if(argc > 2)
		hfs_ls(dev->volume, argv[3]);
	else
		hfs_ls(dev->volume, "/");

	bdevfs_close(dev);
}
示例#3
0
文件: hfs.c 项目: arkanoid1/xpwn
void cmd_ls(Volume* volume, int argc, const char *argv[]) {
	if(argc > 1)
		hfs_ls(volume, argv[1]);
	else
		hfs_ls(volume, "/");
}