is there any API or TCL package that helps to access device and
partition information using the Win32 syntax, for example something like
"drive letter f: corresponds to \Device\Harddisk2\Partition1 which has
the size of 128 GB"
or
"at the moment, the following harddisks and partitions are available:
\Device\Harddisk1\Partition1, \Device\Harddisk2\Partition2, ..."
The lowest level of accessing file information that I found - using the
file command - is the level of drive letters, which of course makes
sense to keep system independent.
If there is no package for this issue - is there a sensefull exec call
(Win XP) that could help me?
Thanks a lot!
Martin
>Hello,
>
>is there any API or TCL package that helps to access device and
>partition information using the Win32 syntax, for example something like
>
>"drive letter f: corresponds to \Device\Harddisk2\Partition1 which has
>the size of 128 GB"
>
>or
>
>"at the moment, the following harddisks and partitions are available:
>\Device\Harddisk1\Partition1, \Device\Harddisk2\Partition2, ..."
Hello Martin,
the TWAPI package (see http://wiki.tcl.tk/9886) offers an easy access
to the Windows API.
Now, how to obtain the information you want using Windows' API I have
no idea. If you don't get an answer here, I suggest turning to a
Windows compiler specific news group (Borland, Microsoft), ask there
which system calls to use and with this info use TWAPI to perform the
necessary calls.
HTH
Helmut Giese
(ashok) 3 % ::twapi::get_mounted_volume_name c:
\\?\Volume{ebf51b60-c651-11d9-ad77-806d6172696f}\
(ashok) 4 % twapi::get_volume_info c: -device
-device {{\Device\HarddiskVolume2}}
Use twapi::find_logical_drives to get drive letters.
Note this will not give you information about partitions that are not
visible to Windows (e.g. unformatted).
/Ashok
get_volume_info c: -size will give size information.
Also, the -device option actually returns a list. The first element is
the device. See the docs for details.
Helmut Giese schrieb:
You can, however, read and parse the partition table on your own, if
it's an MBR partition table. Open {\Device\HarddiskVolume2} for read and
read in exactly 512 bytes, and you'll get the boot record, which
includes the partition table.
--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
(base) 67 % get_volume_info c: -extents
-extents {{-startingoffset 57576960 -disknumber 0 -extentlength
75960460800}}
and
(base) 68 % twapi::_kl_print [lindex [get_physical_disk_info {\\.
\PhysicalDrive0} -layout] 1]
-partitionstyle: mbr
-partitioncount: 4
-partitions: {-hiddensectors 63 -partitionnumber 1 -startingoffset
32256 -partitionstyle mbr -recognizedpartition 1 -partitiontype 0xde -
rewritepartition 0 -partitionlength 57544704 -bootindicator 0} {-
hiddensectors 112455 -partitionnumber 2 -startingoffset 57576960 -
partitionstyle mbr -recognizedpartition 1 -partitiontype 0x07 -
rewritepartition 0 -partitionlength 75960460800 -bootindicator 1} {-
hiddensectors 148472730 -partitionnumber 3 -startingoffset 76018037760
-partitionstyle mbr -recognizedpartition 1 -partitiontype 0xdb -
rewritepartition 0 -partitionlength 4005711360 -bootindicator 0} {-
hiddensectors 0 -partitionnumber 0 -startingoffset 0 -partitionstyle
mbr -recognizedpartition 0 -partitiontype 0x00 -rewritepartition 0 -
partitionlength 0 -bootindicator 0}
-signature: 1101734678
This is not in the released twapi distribution though as I don't (yet)
have gpt formatted disks to test against.
/Ashok
On May 21, 10:36 pm, Darren New <d...@san.rr.com> wrote: