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); }
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); }
void cmd_ls(Volume* volume, int argc, const char *argv[]) { if(argc > 1) hfs_ls(volume, argv[1]); else hfs_ls(volume, "/"); }