comp.lang.ada
 help / color / mirror / Atom feed
* Ada bindings for filesystems
@ 2012-09-06 15:45 alby
  2012-09-07  7:23 ` Dirk Heinrichs
  2012-09-07 13:49 ` alb348
  0 siblings, 2 replies; 8+ messages in thread
From: alby @ 2012-09-06 15:45 UTC (permalink / raw)


Hi

I would like to know, for which filesystems is an Ada binding already available? Possibly, a binding that also supports extended attributes.

Thanks

Ably




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

* Re: Ada bindings for filesystems
  2012-09-06 15:45 Ada bindings for filesystems alby
@ 2012-09-07  7:23 ` Dirk Heinrichs
  2012-09-07  7:44   ` Dmitry A. Kazakov
  2012-09-07 13:49 ` alb348
  1 sibling, 1 reply; 8+ messages in thread
From: Dirk Heinrichs @ 2012-09-07  7:23 UTC (permalink / raw)


alby wrote:

> I would like to know, for which filesystems is an Ada binding already
> available? Possibly, a binding that also supports extended attributes.

Usually, there is no such thing as language bindings to specific filesystems 
as applications do not need to know fs specific things. To handle extended 
attributes/ACLs from within your application, you'd need low level OS 
bindings (for libacl.so and/or libattr.so). Don't know wether they exist, 
though.

HTH...

	Dirk
-- 
Dirk Heinrichs <dirk.heinrichs@altum.de>
Tel: +49 (0)2471 209385 | Mobil: +49 (0)176 34473913
GPG Public Key C2E467BB | Jabber: dirk.heinrichs@altum.de




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

* Re: Ada bindings for filesystems
  2012-09-07  7:23 ` Dirk Heinrichs
@ 2012-09-07  7:44   ` Dmitry A. Kazakov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry A. Kazakov @ 2012-09-07  7:44 UTC (permalink / raw)


On Fri, 07 Sep 2012 09:23:14 +0200, Dirk Heinrichs wrote:

>> I would like to know, for which filesystems is an Ada binding already
>> available? Possibly, a binding that also supports extended attributes.
> 
> Usually, there is no such thing as language bindings to specific filesystems 
> as applications do not need to know fs specific things. To handle extended 
> attributes/ACLs from within your application, you'd need low level OS 
> bindings (for libacl.so and/or libattr.so). Don't know wether they exist, 
> though.

I am not sure if bindings to GIO could qualify, since GIO actually tries to
abstract the underlying filesystem. I have incomplete bindings to GIO,
mainly its parts which would replace Ada.Directories. So it does not
include GFileAttribute for now.

http://developer.gnome.org/gio/stable/gio-GFileAttribute.html

Is this what needed? I cannot tell if AdaCore is going to support GIO in
the coming GtkAda 3.x. If they aren't, I could consider adding it to the
GtkAda contributions.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: Ada bindings for filesystems
  2012-09-06 15:45 Ada bindings for filesystems alby
  2012-09-07  7:23 ` Dirk Heinrichs
@ 2012-09-07 13:49 ` alb348
  2012-09-07 14:13   ` Dmitry A. Kazakov
  1 sibling, 1 reply; 8+ messages in thread
From: alb348 @ 2012-09-07 13:49 UTC (permalink / raw)


Thanks indeed for your suggestions, Dirk and Dmitry.

I must admit that I didn't know about GIO, and I had to look it up in Wikipedia [1]. I am not sure if GIO is what I was looking for, because this solution seems to be integrated within the Gnome framework, while I was looking for something as simple as possible, something independent of any larger framework. I don't want to add unnecessary infrastructures, if I can avoid it. After all, I simply need to access some filesystem functions, so why should I need Gnome? 
The stumbling block, for me, is that I have no experience with writing bindings, and I doubt I would be able to create bindings for the extended attributes. That is why I was looking for available ready-made solutions. Something along the lines of what Dirk was suggesting: bindings to low-level functions of the filesystem.

Has anyone here some experience with binding Ada to low-level (filesystem) functions? Could you at least point me to the right direction to doing that? 

Thanks

Alby

[1] http://en.wikipedia.org/wiki/GIO_(GNOME)




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

* Re: Ada bindings for filesystems
  2012-09-07 13:49 ` alb348
@ 2012-09-07 14:13   ` Dmitry A. Kazakov
  2012-09-07 14:29     ` alb348
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry A. Kazakov @ 2012-09-07 14:13 UTC (permalink / raw)


On Fri, 7 Sep 2012 06:49:34 -0700 (PDT), alb348@gmail.com wrote:

> After all, I simply need to access some filesystem functions, so why
> should I need Gnome? 

Theoretically you don't need it, because GIO is distributed as a library,
which could be used without GNOME. GIO would require some other libraries
from Glib, though.

> Has anyone here some experience with binding Ada to low-level (filesystem)
> functions?

Not specifically this, but many people here.

> Could you at least point me to the right direction to doing that?

ARM B.3 is all you need, assuming that OS interfaces are in C. It is 2-3
API functions you have to import plus some constants to declare. 1-2 hours
of work...

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: Ada bindings for filesystems
  2012-09-07 14:13   ` Dmitry A. Kazakov
@ 2012-09-07 14:29     ` alb348
  2012-09-07 15:27       ` Simon Wright
  2012-09-07 23:14       ` Anh Vo
  0 siblings, 2 replies; 8+ messages in thread
From: alb348 @ 2012-09-07 14:29 UTC (permalink / raw)
  Cc: mailbox

On Friday, September 7, 2012 4:13:42 PM UTC+2, Dmitry A. Kazakov wrote:

> ARM B.3 is all you need, assuming that OS interfaces are in C. It is 2-3
> API functions you have to import plus some constants to declare. 1-2 hours
> of work...

Could you please provide a link to ARM B.3? My Google search turnep unclear results...
Also, will the output of this tool be usable directly from within Ada programs? Or will some external interfaces/dependencies still be required? Thanks again.




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

* Re: Ada bindings for filesystems
  2012-09-07 14:29     ` alb348
@ 2012-09-07 15:27       ` Simon Wright
  2012-09-07 23:14       ` Anh Vo
  1 sibling, 0 replies; 8+ messages in thread
From: Simon Wright @ 2012-09-07 15:27 UTC (permalink / raw)


alb348@gmail.com writes:

> On Friday, September 7, 2012 4:13:42 PM UTC+2, Dmitry A. Kazakov wrote:
>
>> ARM B.3 is all you need, assuming that OS interfaces are in C. It is 2-3
>> API functions you have to import plus some constants to declare. 1-2 hours
>> of work...
>
> Could you please provide a link to ARM B.3? My Google search turnep
> unclear results...

http://www.ada-auth.org/standards/12rm/html/RM-B-3.html

> Also, will the output of this tool be usable directly from within Ada
> programs? Or will some external interfaces/dependencies still be
> required? Thanks again.

Tool?

Dmitry is suggesting that you use the documentation of the C API
functions that your OS provides to write Ada declarations of those
functions and any constants used as parameters. Then, you can link your
Ada programs using those bindings with the same OS library that you
would supply to a C program calling the same API.



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

* Re: Ada bindings for filesystems
  2012-09-07 14:29     ` alb348
  2012-09-07 15:27       ` Simon Wright
@ 2012-09-07 23:14       ` Anh Vo
  1 sibling, 0 replies; 8+ messages in thread
From: Anh Vo @ 2012-09-07 23:14 UTC (permalink / raw)
  Cc: mailbox

On Friday, September 7, 2012 7:29:48 AM UTC-7, (unknown) wrote:
> On Friday, September 7, 2012 4:13:42 PM UTC+2, Dmitry A. Kazakov wrote: > ARM B.3 is all you need, assuming that OS interfaces are in C. It is 2-3 > API functions you have to import plus some constants to declare. 1-2 hours > of work... Could you please provide a link to ARM B.3? My Google search turnep unclear results... Also, will the output of this tool be usable directly from within Ada programs? Or will some external interfaces/dependencies still be required? Thanks again.

Here it is http://www.ada-auth.org/standards/12rm/html/RM-B-3.html

A. Vo



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

end of thread, other threads:[~2012-09-14 18:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-06 15:45 Ada bindings for filesystems alby
2012-09-07  7:23 ` Dirk Heinrichs
2012-09-07  7:44   ` Dmitry A. Kazakov
2012-09-07 13:49 ` alb348
2012-09-07 14:13   ` Dmitry A. Kazakov
2012-09-07 14:29     ` alb348
2012-09-07 15:27       ` Simon Wright
2012-09-07 23:14       ` Anh Vo

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