Revision: 5849 http://jnode.svn.sourceforge.net/jnode/?rev=5849&view=rev Author: lsantha Date: 2011-08-16 20:52:13 +0000 (Tue, 16 Aug 2011)
Log Message: ----------- Improvements 'fdisk' command to output and device parameter. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java Modified: trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2011-08-16 20:49:41 UTC (rev 5848) +++ trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2011-08-16 20:52:13 UTC (rev 5849) @@ -32,6 +32,7 @@ import org.jnode.driver.block.BlockDeviceAPI; import org.jnode.driver.bus.ide.IDEConstants; import org.jnode.driver.bus.ide.IDEDevice; +import org.jnode.driver.bus.ide.IDEDeviceAPI; import org.jnode.driver.bus.ide.IDEDriveDescriptor; import org.jnode.naming.InitialNaming; import org.jnode.partitions.ibm.IBMPartitionTable; @@ -83,8 +84,9 @@ private final IBMPartitionTypeArgument ARG_TYPE = new IBMPartitionTypeArgument("type", Argument.OPTIONAL, "IBM partition type code"); + //todo add support for more BlockDeviceAPI types private final DeviceArgument ARG_DEVICE = - new DeviceArgument("deviceId", Argument.OPTIONAL, "Target device", BlockDeviceAPI.class); + new DeviceArgument("deviceId", Argument.OPTIONAL, "Target device", IDEDeviceAPI.class); public FdiskCommand() { super("perform disk partition management tasks"); @@ -200,14 +202,13 @@ private void listAvailableDevices(DeviceManager dm, PrintWriter out) { final Collection<Device> allDevices = dm.getDevicesByAPI(BlockDeviceAPI.class); for (Device dev : allDevices) { - out.println("Found device : " + dev.getId() + "[" + dev.getClass() + "]"); + //out.println("Found device : " + dev.getId() + "[" + dev.getClass() + "]"); if (dev instanceof IDEDevice) { IDEDevice ideDevice = (IDEDevice) dev; IDEDriveDescriptor desc = ideDevice.getDescriptor(); if (desc.isDisk()) { - out.println(" IDE Disk : " + ideDevice.getId() + "(" + desc.getModel() + - " " + desc.getSectorsAddressable() * IDEConstants.SECTOR_SIZE + - ")"); + out.println("IDE Disk: " + ideDevice.getId() + "('" + desc.getModel() + "' " + + desc.getSectorsAddressable() * IDEConstants.SECTOR_SIZE + " bytes)"); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 _______________________________________________ Jnode-svn-commits mailing list Jnode-svn-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jnode-svn-commits