From: jmc on
Hello,

We have a database application (SQLite + Tcl/Tk 8.5) running on
Windows XP.

We would like to know if it is possible to get in Tcl the available
free space of the hard disk on wich is running our application.

Thanks.

Jean-Marie
From: Larry W. Virden on
On Jun 11, 4:53 am, jmc <jm.c...(a)orens.fr> wrote:
> Hello,
>
> We have a database application (SQLite + Tcl/Tk 8.5) running on
> Windows XP.
>
> We would like to know if it is possible to get in Tcl the available
> free space of the hard disk on wich is running our application.

Tcl doesn't build in a lot of OS specific tools. Instead, it provides
the exec and open commands to allow you to invoke commands to perform
those functions. It also provides a pretty clean interface to write
glue between system function DLLs and Tcl code.

Take a look at http://wiki.tcl.tk/twapi - I suspect that Windows
extension might have the functionality you need
From: Jibal on
On 11 juin, 10:53, jmc <jm.c...(a)orens.fr> wrote:
> Hello,
>
> We have a database application (SQLite + Tcl/Tk 8.5) running on
> Windows XP.
>
> We would like to know if it is possible to get in Tcl the available
> free space of the hard disk on wich is running our application.
>
> Thanks.
>
> Jean-Marie

Hi Jean-Marie,

Find "Disk Free Capacity" chapter on this page: http://wiki.tcl.tk/526

The free_win proc seems to work on my ole Win2K...

Regards.
From: Kevin Kenny on
jmc wrote:
> We would like to know if it is possible to get in Tcl the available
> free space of the hard disk on wich is running our application.

Not directly with core commands, as far as I know, but there are
a couple of possibilities:

(1) Scrape it from the command line:

set data [exec {*}[auto_execok dir] C:\\ /-C]
if {[regexp {(\d+) bytes free} $data -> freespace]} {
puts "drive C: has $freespace bytes available"
}

(2) Install TWAPI and use the 'get_volume_info' command:

http://twapi.magicsplat.com/disk.html#get_volume_info

--
73 de ke9tv/2, Kevin
From: jmc on
On 11 juin, 13:52, Kevin Kenny <kenn...(a)acm.org> wrote:
> jmc wrote:
> > We would like to know if it is possible to get in Tcl the available
> > free space of the hard disk on wich is running our application.
>
> Not directly with core commands, as far as I know, but there are
> a couple of possibilities:
>
> (1) Scrape it from the command line:
>
>      set data [exec {*}[auto_execok dir] C:\\ /-C]
>      if {[regexp {(\d+) bytes free} $data -> freespace]} {
>          puts "drive C: has $freespace bytes available"
>      }
>
> (2) Install TWAPI and use the 'get_volume_info' command:
>
>      http://twapi.magicsplat.com/disk.html#get_volume_info
>
> --
> 73 de ke9tv/2, Kevin

Many thanks for your reply. We have choosen the TWAPI solution wich
suit our needs.
It gave us the opportunity to discover the TWAPI extension : a very
usefull package when developping for Windows.

Thanks again.

Jean-Marie
 | 
Pages: 1
Prev: Image on canvas
Next: ANNOUNCE: TkDND 2.1