comp.lang.ada
 help / color / mirror / Atom feed
* how to adapt a path name to the OS
@ 2005-05-04 16:19 evangeli
  2005-05-04 16:24 ` Martin Dowie
  0 siblings, 1 reply; 8+ messages in thread
From: evangeli @ 2005-05-04 16:19 UTC (permalink / raw)


Hello
let us assume i have a string S corresponding to a path that has the
following value :
"/home/test/me/test path"

is there a predefined function that can adapt S to my OS. On my example
i'll have
F(S) = "/home/test/me/test\ path"

Thanks




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

* Re: how to adapt a path name to the OS
  2005-05-04 16:19 how to adapt a path name to the OS evangeli
@ 2005-05-04 16:24 ` Martin Dowie
  2005-05-04 16:28   ` evangeli
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Dowie @ 2005-05-04 16:24 UTC (permalink / raw)


evangeli@cnam.fr wrote:
> Hello
> let us assume i have a string S corresponding to a path that has the
> following value :
> "/home/test/me/test path"
> 
> is there a predefined function that can adapt S to my OS. On my example
> i'll have
> F(S) = "/home/test/me/test\ path"

No, not predefined.

Cheers

-- Martin



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

* Re: how to adapt a path name to the OS
  2005-05-04 16:24 ` Martin Dowie
@ 2005-05-04 16:28   ` evangeli
  2005-05-04 16:32     ` Martin Dowie
  2005-05-04 17:03     ` Ludovic Brenta
  0 siblings, 2 replies; 8+ messages in thread
From: evangeli @ 2005-05-04 16:28 UTC (permalink / raw)


thanks for your help
for unix how can i know all the special chars that have to be preceded
by a '\' ?




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

* Re: how to adapt a path name to the OS
  2005-05-04 16:28   ` evangeli
@ 2005-05-04 16:32     ` Martin Dowie
  2005-05-04 16:44       ` evangeli
  2005-05-04 17:03     ` Ludovic Brenta
  1 sibling, 1 reply; 8+ messages in thread
From: Martin Dowie @ 2005-05-04 16:32 UTC (permalink / raw)


evangeli@cnam.fr wrote:
> thanks for your help
> for unix how can i know all the special chars that have to be preceded
> by a '\' ?

What compiler (inc version)/OS are you using?

If you are using Linux and a more recent version of GNAT/gcc then you 
may find that all you really need is in Ada.Directories.

Cheers

-- Martin



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

* Re: how to adapt a path name to the OS
  2005-05-04 16:32     ` Martin Dowie
@ 2005-05-04 16:44       ` evangeli
  2005-05-04 17:06         ` Adrien Plisson
  0 siblings, 1 reply; 8+ messages in thread
From: evangeli @ 2005-05-04 16:44 UTC (permalink / raw)


It seems i do not have ada.directories on my system
i have gnat 3.15p
do you know where i can find a more recent version?




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

* Re: how to adapt a path name to the OS
  2005-05-04 16:28   ` evangeli
  2005-05-04 16:32     ` Martin Dowie
@ 2005-05-04 17:03     ` Ludovic Brenta
  2005-05-04 17:14       ` evangeli
  1 sibling, 1 reply; 8+ messages in thread
From: Ludovic Brenta @ 2005-05-04 17:03 UTC (permalink / raw)


 writes:
> thanks for your help
> for unix how can i know all the special chars that have to be preceded
> by a '\' ?

The quotes are only needed to protect certain characters from the
shell.  So, you need to quote only if you want to pass the string to a
shell.  In the case of bash, I suggest you give up on quoting and
simply enclose the path in single quotes (').

If you want to pass the string to Ada.Text_IO.Open to open a file,
then you don't need quoting at all.

HTH

-- 
Ludovic Brenta.



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

* Re: how to adapt a path name to the OS
  2005-05-04 16:44       ` evangeli
@ 2005-05-04 17:06         ` Adrien Plisson
  0 siblings, 0 replies; 8+ messages in thread
From: Adrien Plisson @ 2005-05-04 17:06 UTC (permalink / raw)


evangeli@cnam.fr wrote:
> It seems i do not have ada.directories on my system
> i have gnat 3.15p

so you may look at GNAT.Directory_Operations (g-dirope.ads)

-- 
rien



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

* Re: how to adapt a path name to the OS
  2005-05-04 17:03     ` Ludovic Brenta
@ 2005-05-04 17:14       ` evangeli
  0 siblings, 0 replies; 8+ messages in thread
From: evangeli @ 2005-05-04 17:14 UTC (permalink / raw)


yes it helps
i am using procedure Gnat.Os_Lib.Spawn
before calling it i call Argument_String_To_List on a string that
contains a path with spaces

sorry for bothering you with this stupid mistake




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

end of thread, other threads:[~2005-05-04 17:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-04 16:19 how to adapt a path name to the OS evangeli
2005-05-04 16:24 ` Martin Dowie
2005-05-04 16:28   ` evangeli
2005-05-04 16:32     ` Martin Dowie
2005-05-04 16:44       ` evangeli
2005-05-04 17:06         ` Adrien Plisson
2005-05-04 17:03     ` Ludovic Brenta
2005-05-04 17:14       ` evangeli

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