comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeff Creem" <jeff@thecreems.com>
Subject: Re: Ada and Hardware
Date: Thu, 10 May 2001 23:35:25 GMT
Date: 2001-05-10T23:35:25+00:00	[thread overview]
Message-ID: <1BFK6.19477$9j1.4714444@typhoon.ne.mediaone.net> (raw)
In-Reply-To: JLCK6.91$j65.11856@www.newsranger.com


"Ted Dennison" <dennison@telepath.com> wrote in message
news:JLCK6.91$j65.11856@www.newsranger.com...
> In article <3AFACEC7.C2E67357@icn.siemens.de>, Alfred Hilscher says...
> >
> >Maybe the Windows API calls "CreateFile" and "DeviceIOControl" will be
> >what you are looking for ? Look for this excerpt from   MS-API
> ..
> >"You can use the CreateFile function to open a disk drive or a partition
> ..
> >\\.\A: Obtains a handle to drive A on the user's computer.
> >\\.\C: Obtains a handle to drive C on the user's computer."
>
> Interesting. One has to wonder if this would work with the standard Ada IO
> operations (eg: Ada.Streams.Stream_IO)...
>

I just had to know to. It looks like it does not work.

with Ada.Streams.Stream_IO;
with Ada.Streams;

procedure Show_It is

  Buffer : Ada.Streams.Stream_Element_Array (1 .. 2048) := (others => 0);


  File : Ada.Streams.Stream_IO.File_Type;

begin
  Ada.Streams.Stream_IO.Open
    (
    File => File,
    Name => "\\.\A:",
    Mode => Ada.Streams.Stream_IO.Out_File);

  Ada.Streams.Stream_IO.Write
    (
    File => File,
    Item => Buffer);

  Ada.Streams.Stream_IO.Write
    (
    File => File,
    Item => Buffer);

  Ada.Streams.Stream_IO.Write
    (
    File => File,
    Item => Buffer);

  Ada.Streams.Stream_IO.Close(File);
end Show_It;


Raises a name error on the open.  I tried a few quick variations on it.
(Including create instead
of open).








  reply	other threads:[~2001-05-10 23:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-10 13:02 Ada and Hardware chris.danx
2001-05-10 13:36 ` Ted Dennison
2001-05-10 14:00   ` chris.danx
2001-05-10 14:52     ` Ted Dennison
2001-05-10 18:20       ` chris.danx
2001-05-10 20:01         ` Jerry van Dijk
2001-05-10 20:54           ` chris.danx
2001-05-10 13:54 ` Tarjei T. Jensen
2001-05-10 14:10   ` chris.danx
2001-05-10 14:34     ` Tarjei T. Jensen
2001-05-10 18:28       ` chris.danx
2001-05-14  7:40         ` Kretschmer, Matthias
2001-05-10 17:24 ` Alfred Hilscher
2001-05-10 20:22   ` Ted Dennison
2001-05-10 23:35     ` Jeff Creem [this message]
2001-05-10 23:58       ` Fraser Wilson
2001-05-11  1:54         ` Jeff Creem
2001-05-11 19:13       ` Randy Brukardt
2001-05-14 10:27         ` Alfred Hilscher
2001-05-10 20:53   ` chris.danx
2001-05-11 21:45 ` GNAT for DOS chris.danx
2001-05-13 19:52 ` Ada and Hardware chris.danx
2001-05-14  0:18   ` Jeff Creem
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox