comp.lang.ada
 help / color / mirror / Atom feed
* Retrieve CD-R TOC
@ 2002-07-13  0:29 Filoux
  2002-07-13  1:07 ` sk
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Filoux @ 2002-07-13  0:29 UTC (permalink / raw)


Hello!!

I'd like to know if it's possible to retrieve the table of content
(TOC) of a CD with ADA. I'm currently running linux and I need to get
some information (like cd content, size of files, etc...). I don't
want to do it by executing a system call like (du -ah) but I'd like to
do it by accessing the TOC of the CD (or DVD).

Thanks in advance for your answers, Best Regards, Filoux.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Retrieve CD-R TOC
  2002-07-13  0:29 Retrieve CD-R TOC Filoux
@ 2002-07-13  1:07 ` sk
  2002-07-13  1:58 ` Larry Kilgallen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: sk @ 2002-07-13  1:07 UTC (permalink / raw)


Hi,

> I'd like to know if it's possible to retrieve the table of 
> content (TOC) of a CD with ADA.

The answer to this and any similar question is YES (if there are C
calls to the OS and sub-systems, then there is generally little 
effort required to make equivalent Ada calls to the OS).

Your question, perhaps, might have been better if you asked are 
there any readily available Ada bindings to the Linux CD interface 
libraries ?

Has anyone made Ada bindings to the generic scsi interface (this,
I believe, also provides the IDE-CD interface) of Linux ?

This, I do not know :-) 

Unless someone else points you to a specific binding, start at 
AdaPower.com, then AdaIC and then perhaps google, searching for
scsi bindings in Ada (I am reasonably sure that the IDE CD 
interface for Linux is gained through the Linux scsi interface).

-- 
-------------------------------------
-- Merge vertically for real address
-------------------------------------
s n p @ t . o
 k i e k c c m
-------------------------------------



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Retrieve CD-R TOC
  2002-07-13  0:29 Retrieve CD-R TOC Filoux
  2002-07-13  1:07 ` sk
@ 2002-07-13  1:58 ` Larry Kilgallen
  2002-07-13 13:58 ` Filoux
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Larry Kilgallen @ 2002-07-13  1:58 UTC (permalink / raw)


In article <f7c083d5.0207121629.1c67fb4a@posting.google.com>, Filoux@orange.fr (Filoux) writes:
> Hello!!
> 
> I'd like to know if it's possible to retrieve the table of content
> (TOC) of a CD with ADA. I'm currently running linux and I need to get
> some information (like cd content, size of files, etc...). I don't
> want to do it by executing a system call like (du -ah) but I'd like to
> do it by accessing the TOC of the CD (or DVD).

The method for doing this depends entirely on the format in which the
CDROM is written.  HFS, ISO9660, etc. all have different data formats
on disc.

If you want to write an Ada program to read a particular format, you
need to get a copy of the specification for that format.  I am very
familiar with ISO9660 and is non-trivial to get it right, particularly
if you want the RockRidge extensions for Posix to be supported.  You
would almost certainly be better off if you could find a Linux OS
call to do it for you rather than writing it yourself in Ada (or any
other language).  This is despite the fact that there are certain
areas in which Linux does not handle the entire ISO9660 specification.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Retrieve CD-R TOC
  2002-07-13  0:29 Retrieve CD-R TOC Filoux
  2002-07-13  1:07 ` sk
  2002-07-13  1:58 ` Larry Kilgallen
@ 2002-07-13 13:58 ` Filoux
  2002-07-14 22:45 ` Jacob Sparre Andersen
  2002-07-15 14:47 ` Steffen Huber
  4 siblings, 0 replies; 7+ messages in thread
From: Filoux @ 2002-07-13 13:58 UTC (permalink / raw)


Thanks for your answers!! I'll have a look at this and post-up for any
news. Thanks again!!

Best Regards, Filoux.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Retrieve CD-R TOC
  2002-07-13  0:29 Retrieve CD-R TOC Filoux
                   ` (2 preceding siblings ...)
  2002-07-13 13:58 ` Filoux
@ 2002-07-14 22:45 ` Jacob Sparre Andersen
  2002-07-14 23:57   ` sk
  2002-07-15 14:47 ` Steffen Huber
  4 siblings, 1 reply; 7+ messages in thread
From: Jacob Sparre Andersen @ 2002-07-14 22:45 UTC (permalink / raw)


Filoux wrote:

> I'd like to know if it's possible to retrieve the table of content
> (TOC) of a CD with ADA.

[ Its "Ada", not "ADA"! ]

If you use GNAT (and don't mind writing GNAT specific code) 
you can use the package "GNAT.Directory_Operations".

Greetings,

Jacob
-- 
Do you have a job for a physicist with experience in:

  * Complex systems (mostly turbulence experiments)
  * Geoscience (a bit of oceanography and geology)
  * Programming (mostly in Ada and Pascal)




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Retrieve CD-R TOC
  2002-07-14 22:45 ` Jacob Sparre Andersen
@ 2002-07-14 23:57   ` sk
  0 siblings, 0 replies; 7+ messages in thread
From: sk @ 2002-07-14 23:57 UTC (permalink / raw)


Hi,

Jacob Sparre Andersen <sparre@nbi.dk>
> ... package "GNAT.Directory_Operations".

If I understand the OP correctly, the OP is looking 
for the CD TOC which is a different data abstraction
than a directory listing.

If you use a Linux system, read the "CD-Writing HOWTO"
from the "Linux Documentation Project" and play with
"cdrecord -toc ..." to see the difference.

I don't believe that GNAT.Directory_Operations supplies 
the TOC :-)

If the OP is still reading this thread, and hasn't found 
a binding solution, the source for "cdrecord" might be
a starting point for an Ada binding.

-- 
-------------------------------------
-- Merge vertically for real address
-------------------------------------
s n p @ t . o
 k i e k c c m
-------------------------------------



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Retrieve CD-R TOC
  2002-07-13  0:29 Retrieve CD-R TOC Filoux
                   ` (3 preceding siblings ...)
  2002-07-14 22:45 ` Jacob Sparre Andersen
@ 2002-07-15 14:47 ` Steffen Huber
  4 siblings, 0 replies; 7+ messages in thread
From: Steffen Huber @ 2002-07-15 14:47 UTC (permalink / raw)


Filoux wrote:
> Hello!!

Hi,

> I'd like to know if it's possible to retrieve the table of content
> (TOC) of a CD with ADA.

Nearly everything is possible with Ada ;-)

> I'm currently running linux and I need to get
> some information (like cd content, size of files, etc...).

Hmmmm...size of files? Unless I completely misunderstand you, you won't be
able to get the size of files out of a CD's TOC. The TOC has only
information about the start and the type (audio, data...) of a CD track
(and indexes and possibly CD Text and if it is 2 or 4 channel stereo
and if it is a multisession disc...).

The TOC does not know anything about files - you would have to examine
the data blocks on a CD and decode the ISO9660 (or Joliet or RockRidge)
directory information.

> I don't want to do it by executing a system call like (du -ah) but
> I'd like to do it by accessing the TOC of the CD (or DVD).

I would suggest that you look at the cdrecord sources and create some
bindings to the SCSI transportation layer that cdrecord uses.

For information about the Read TOC SCSI/IDE command, look at the
ATAPI and SCSI-II (and probably MMC) specs.

I have written a nice library to do things like that (and much more,
like e.g. writing CDs), but it is only usable for the RISC OS
operating system, and it is all inside a commercial CD writing
package ;-)

Steffen

-- 
steffen.huber@gmx.de               steffen@huber-net.de
GCC for RISC OS  - http://www.arcsite.de/hp/gcc/
Private homepage - http://www.huber-net.de/



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-07-15 14:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-13  0:29 Retrieve CD-R TOC Filoux
2002-07-13  1:07 ` sk
2002-07-13  1:58 ` Larry Kilgallen
2002-07-13 13:58 ` Filoux
2002-07-14 22:45 ` Jacob Sparre Andersen
2002-07-14 23:57   ` sk
2002-07-15 14:47 ` Steffen Huber

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