comp.lang.ada
 help / color / mirror / Atom feed
* File rename in Ada95
@ 2008-10-30 14:56 Maciej Sobczak
  2008-10-30 16:37 ` Adam Beneschan
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Maciej Sobczak @ 2008-10-30 14:56 UTC (permalink / raw)


Hi,

What is the recommended way to rename a file in Ada95?
Ada.Directories is not invented yet and GNAT.Directory_Operations is
not smart enough.
Target platform: Linux.

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com

Database Access Library for Ada: www.inspirel.com/soci-ada



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

* Re: File rename in Ada95
  2008-10-30 14:56 File rename in Ada95 Maciej Sobczak
@ 2008-10-30 16:37 ` Adam Beneschan
  2008-10-30 17:14 ` anon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Adam Beneschan @ 2008-10-30 16:37 UTC (permalink / raw)


On Oct 30, 7:56 am, Maciej Sobczak <see.my.homep...@gmail.com> wrote:
> Hi,
>
> What is the recommended way to rename a file in Ada95?
> Ada.Directories is not invented yet and GNAT.Directory_Operations is
> not smart enough.
> Target platform: Linux.

I'd just use the Import pragma to get at the rename(2) system call.

                                -- Adam



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

* Re: File rename in Ada95
  2008-10-30 14:56 File rename in Ada95 Maciej Sobczak
  2008-10-30 16:37 ` Adam Beneschan
@ 2008-10-30 17:14 ` anon
  2008-10-30 17:32 ` Robert A Duff
  2008-10-31 20:00 ` Thomas Locke
  3 siblings, 0 replies; 13+ messages in thread
From: anon @ 2008-10-30 17:14 UTC (permalink / raw)


I would say to load the file in memory if memory is available, just in case 
the program cashes.  Plus it save, speed of accessing the data file. Memory 
it cheap where Time is not.

Or it is better to create a subroutine to copy the old file to a temporary new 
file then use that temporary file in your program. That way, the orginal file 
still exist, just in case your program crashes.

The lack of the delete and rename function was a part of the DOD requirement 
for data safety and security.  And since Ada specification are no long under 
that strict requirement the delete and rename function have been added.

In <c35ed55f-1f29-4dc3-badd-f8265b83b214@v15g2000hsa.googlegroups.com>, Maciej Sobczak <see.my.homepage@gmail.com> writes:
>Hi,
>
>What is the recommended way to rename a file in Ada95?
>Ada.Directories is not invented yet and GNAT.Directory_Operations is
>not smart enough.
>Target platform: Linux.
>
>--
>Maciej Sobczak * www.msobczak.com * www.inspirel.com
>
>Database Access Library for Ada: www.inspirel.com/soci-ada




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

* Re: File rename in Ada95
  2008-10-30 14:56 File rename in Ada95 Maciej Sobczak
  2008-10-30 16:37 ` Adam Beneschan
  2008-10-30 17:14 ` anon
@ 2008-10-30 17:32 ` Robert A Duff
  2008-10-31  0:11   ` anon
  2008-10-31 20:00 ` Thomas Locke
  3 siblings, 1 reply; 13+ messages in thread
From: Robert A Duff @ 2008-10-30 17:32 UTC (permalink / raw)


Maciej Sobczak <see.my.homepage@gmail.com> writes:

> What is the recommended way to rename a file in Ada95?
> Ada.Directories is not invented yet and GNAT.Directory_Operations is
> not smart enough.
> Target platform: Linux.

In GNAT, you can use Ada.Directories in Ada 95 mode.

- Bob



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

* Re: File rename in Ada95
  2008-10-30 17:32 ` Robert A Duff
@ 2008-10-31  0:11   ` anon
  2008-10-31 13:44     ` Robert A Duff
  0 siblings, 1 reply; 13+ messages in thread
From: anon @ 2008-10-31  0:11 UTC (permalink / raw)


In <wccy706xa3b.fsf@shell01.TheWorld.com>, Robert A Duff <bobduff@shell01.TheWorld.com> writes:
>
Your version will cause errors.  

The first statement in Ada.Directories for GNAT Ada 2005 specs 
(2005-2007, did not check 2008 version) is:
   pragma Ada_05;

which limits the package usage to Ada 2005 specs only. If one trys to 
uses the package by set mode to 95 by using "-gnat95" the pragma will 
generate errors.

>
>Maciej Sobczak <see.my.homepage@gmail.com> writes:
>
>> What is the recommended way to rename a file in Ada95?
>> Ada.Directories is not invented yet and GNAT.Directory_Operations is
>> not smart enough.
>> Target platform: Linux.
>
>In GNAT, you can use Ada.Directories in Ada 95 mode.
>
>- Bob




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

* Re: File rename in Ada95
  2008-10-31  0:11   ` anon
@ 2008-10-31 13:44     ` Robert A Duff
  2008-10-31 17:24       ` anon
  0 siblings, 1 reply; 13+ messages in thread
From: Robert A Duff @ 2008-10-31 13:44 UTC (permalink / raw)


anon@anon.org (anon) writes:

> In <wccy706xa3b.fsf@shell01.TheWorld.com>, Robert A Duff <bobduff@shell01.TheWorld.com> writes:
>>
> Your version will cause errors.  
>
> The first statement in Ada.Directories for GNAT Ada 2005 specs 
> (2005-2007, did not check 2008 version) is:
>    pragma Ada_05;

This pragma has been removed from Ada.Directories in the latest version
(about a year and a half ago).

> which limits the package usage to Ada 2005 specs only. If one trys to 
> uses the package by set mode to 95 by using "-gnat95" the pragma will 
> generate errors.

If you say "with Ada.Directories;" in -gnat95 mode,
you will get a warning, not an error.  This is independent
of the above-mentioned pragma.

- Bob



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

* Re: File rename in Ada95
  2008-10-31 13:44     ` Robert A Duff
@ 2008-10-31 17:24       ` anon
  2008-11-01  8:39         ` Ludovic Brenta
  2008-11-01 22:04         ` sjw
  0 siblings, 2 replies; 13+ messages in thread
From: anon @ 2008-10-31 17:24 UTC (permalink / raw)


In <wccabckhoau.fsf@shell01.TheWorld.com>, Robert A Duff <bobduff@shell01.TheWorld.com> writes:

First, when someone states Ada95 they mean pre Ada 2005 version. And 
all pre Ada 2005 version do not have "Ada.Directories". Also if you add that 
package from Ada 2005 spec then you are defeating the concept of using 
"-gnat95". And that why Adacore added the "pragma Ada_05" in the first 
place.

And if your version does not have it then the maintainer of your version do 
not care to maintain the RM of Ada for those who still want to use Ada 95
specs. Which means it should not be use except may be in a classroom for 
non-standard compilers.


Plus recheck your copy, it depend upon where you get your copy of GNAT, 
if it has been modified. The version I was speaking of was downloaded 
from Adacore web site in Aug 2008. 


>anon@anon.org (anon) writes:
>
>> In <wccy706xa3b.fsf@shell01.TheWorld.com>, Robert A Duff <bobduff@shell01.TheWorld.com> writes:
>>>
>> Your version will cause errors.  
>>
>> The first statement in Ada.Directories for GNAT Ada 2005 specs 
>> (2005-2007, did not check 2008 version) is:
>>    pragma Ada_05;
>
>This pragma has been removed from Ada.Directories in the latest version
>(about a year and a half ago).
>
>> which limits the package usage to Ada 2005 specs only. If one trys to 
>> uses the package by set mode to 95 by using "-gnat95" the pragma will 
>> generate errors.
>
>If you say "with Ada.Directories;" in -gnat95 mode,
>you will get a warning, not an error.  This is independent
>of the above-mentioned pragma.
>
>- Bob




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

* Re: File rename in Ada95
  2008-10-30 14:56 File rename in Ada95 Maciej Sobczak
                   ` (2 preceding siblings ...)
  2008-10-30 17:32 ` Robert A Duff
@ 2008-10-31 20:00 ` Thomas Locke
  3 siblings, 0 replies; 13+ messages in thread
From: Thomas Locke @ 2008-10-31 20:00 UTC (permalink / raw)


Maciej Sobczak wrote:
> Hi,
> 
> What is the recommended way to rename a file in Ada95?
> Ada.Directories is not invented yet and GNAT.Directory_Operations is
> not smart enough.
> Target platform: Linux.

http://www.cs.scranton.edu/~beidler/Ada/posix/posix-files.html

More here:  http://edb.jacob-sparre.dk/Posix_in_Ada/

I'm way too much of a newbie to know if this is what you're looking for, 
but at least it's an option.

:o)
/Thomas



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

* Re: File rename in Ada95
  2008-10-31 17:24       ` anon
@ 2008-11-01  8:39         ` Ludovic Brenta
  2008-11-02  9:39           ` anon
  2008-11-01 22:04         ` sjw
  1 sibling, 1 reply; 13+ messages in thread
From: Ludovic Brenta @ 2008-11-01  8:39 UTC (permalink / raw)


anon wrote in a reply to Bob Duff:
> Plus recheck your copy, it depend upon where you get your copy of GNAT,
> if it has been modified. The version I was speaking of was downloaded
> from Adacore web site in Aug 2008.

Anon, once again you made a fool of yourself in public. Bob Duff works
for AdaCore. He knows better than you do.

--
Ludovic Brenta.



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

* Re: File rename in Ada95
  2008-10-31 17:24       ` anon
  2008-11-01  8:39         ` Ludovic Brenta
@ 2008-11-01 22:04         ` sjw
  1 sibling, 0 replies; 13+ messages in thread
From: sjw @ 2008-11-01 22:04 UTC (permalink / raw)


On Oct 31, 5:24 pm, a...@anon.org (anon) wrote:

> Plus recheck your copy, it depend upon where you get your copy of GNAT,
> if it has been modified. The version I was speaking of was downloaded
> from Adacore web site in Aug 2008.

And the version contained in the GCC 4.3.0 source files was modified 6
June 2007 and says

--  Ada 2005: Implementation of Ada.Directories (AI95-00248). Note
that this
--  unit is available without -gnat05. That seems reasonable, since
you only
--  get it if you explicitly ask for it.




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

* Re: File rename in Ada95
  2008-11-01  8:39         ` Ludovic Brenta
@ 2008-11-02  9:39           ` anon
  2008-11-02 20:35             ` Ludovic Brenta
  0 siblings, 1 reply; 13+ messages in thread
From: anon @ 2008-11-02  9:39 UTC (permalink / raw)


Ludovic Brenta, Until you and your team of Ada supporters at least get 
"Polyorb" and/or GLADE up and running under the latest GNAT/gcc. You 
should bypass reading this forum. And the fix to those packages are easy.

And as for Duff. If he re-read the initial post of this thread Duff would see 
that Maciej Sobczak stated his version of Ada does not have Ada.Directories 
which make Duff post a foolish post or may be Robert Duff need to update his 
glasses so he can read the post!  Because this is not the first post that Duff 
has assume that all GNAT users are using the latest GNAT version. There 
are some that still ask questions that deals with Ada 95 only systems, like 
DOS users to name one type.  Also some users want to follow the strict 
guidelines of the RM and not add vendors extensions to the RM or mix Ada 
specs.

And as for Simon, that comment has been there in every version of GNAT 
from 2005 though 2008. And until 2008 version, when Adacore finally 
removed the "pragma Ada_05;" statement that comment was meanless. 
And if you check most packages of GNAT you will find a lot of meanless 
comments.

Also, downloaded and check Nov 1, 2008.
    gnat-gpl-2007-src.tgz -- has the "pragma Ada_05;"
    gnat-gpl-2008-src.tgz -- the "pragma Ada_05;" has been removed.

And just like some people are still using XP there are people who are still 
using GNAT-GPL-2007 or using GNAT-3.15.  One reason is Annex E. So, 
do not assume that all GNAT users are using GNAT 2008, and this goes 
duuble, especially when they say "Ada95" in the title.


In <373c802c-8914-4bb8-9417-9d2c9f905189@a29g2000pra.googlegroups.com>, Ludovic Brenta <ludovic@ludovic-brenta.org> writes:
>anon wrote in a reply to Bob Duff:
>> Plus recheck your copy, it depend upon where you get your copy of GNAT,
>> if it has been modified. The version I was speaking of was downloaded
>> from Adacore web site in Aug 2008.
>
>Anon, once again you made a fool of yourself in public. Bob Duff works
>for AdaCore. He knows better than you do.
>
>--
>Ludovic Brenta.




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

* Re: File rename in Ada95
  2008-11-02  9:39           ` anon
@ 2008-11-02 20:35             ` Ludovic Brenta
  2008-11-03  4:50               ` anon
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Brenta @ 2008-11-02 20:35 UTC (permalink / raw)


On Nov 2, 10:39 am, a...@anon.org (anon) wrote:
> Ludovic Brenta, Until you and your team of Ada supporters at least get
> "Polyorb" and/or GLADE up and running under the latest GNAT/gcc. You
> should bypass reading this forum. And the fix to those packages are easy.

This kind of rhethoric will bring you only contempt. (1) you tried to
change the subject from Ada.Directories to PolyORB for no good reason;
(2) you tried a futile ad-hominem attack (did you really think you
would scare me away or otherwise impress me?) (3) if fixing PolyORB is
so easy, send "me and my team" a patch and "me and my team" will be
happy to incorporate it in Debian. Patches, not rants, will bring you
credibility. And (4), "me and my team" are volunteers and we take
orders from no one.

[...]
> Because this is not the first post that Duff
> has assume that all GNAT users are using the latest GNAT version

Here is another well-known and despicable rhethorical device:
unrelated and unsubstantiated claims that are impossible to prove or
disprove, with the only aim to create Fear, Uncertainty and Doubt.

In my mind there is no Fear. I do not fear you or your rants, "anon".
There is no Uncertainty and no Doubt either. Ergo, you failed utterly
in your futile attempts. You only succeeded in bringing more hostility
to your posts.

Enough.

--
Ludovic Brenta.



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

* Re: File rename in Ada95
  2008-11-02 20:35             ` Ludovic Brenta
@ 2008-11-03  4:50               ` anon
  0 siblings, 0 replies; 13+ messages in thread
From: anon @ 2008-11-03  4:50 UTC (permalink / raw)


No! I was telling you to it was not you problem until your stupid name 
calling post! You have other problems that most GNAT Ada users would 
prefer you deal with like getting Polyorb or Glade to work. But instead of 
improving GNAT Ada it seams that you would prefer to be the playground 
bully or busy body and getting into everybody business, instead.

Some people such as schools would I think appreciate you spending your 
valuable time on Annex E instead of,. in here calling people name like a 
little spoiled brat.

And remember this you started the name calling, I did not!

In <1090f441-6358-4d59-a353-3f8a6b3f27e9@n1g2000prb.googlegroups.com>, Ludovic Brenta <ludovic@ludovic-brenta.org> writes:
>On Nov 2, 10:39 am, a...@anon.org (anon) wrote:
>> Ludovic Brenta, Until you and your team of Ada supporters at least get
>> "Polyorb" and/or GLADE up and running under the latest GNAT/gcc. You
>> should bypass reading this forum. And the fix to those packages are easy.
>
>This kind of rhethoric will bring you only contempt. (1) you tried to
>change the subject from Ada.Directories to PolyORB for no good reason;
>(2) you tried a futile ad-hominem attack (did you really think you
>would scare me away or otherwise impress me?) (3) if fixing PolyORB is
>so easy, send "me and my team" a patch and "me and my team" will be
>happy to incorporate it in Debian. Patches, not rants, will bring you
>credibility. And (4), "me and my team" are volunteers and we take
>orders from no one.
>
>[...]
>> Because this is not the first post that Duff
>> has assume that all GNAT users are using the latest GNAT version
>
>Here is another well-known and despicable rhethorical device:
>unrelated and unsubstantiated claims that are impossible to prove or
>disprove, with the only aim to create Fear, Uncertainty and Doubt.
>
>In my mind there is no Fear. I do not fear you or your rants, "anon".
>There is no Uncertainty and no Doubt either. Ergo, you failed utterly
>in your futile attempts. You only succeeded in bringing more hostility
>to your posts.
>
>Enough.
>
>--
>Ludovic Brenta.




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

end of thread, other threads:[~2008-11-03  4:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-30 14:56 File rename in Ada95 Maciej Sobczak
2008-10-30 16:37 ` Adam Beneschan
2008-10-30 17:14 ` anon
2008-10-30 17:32 ` Robert A Duff
2008-10-31  0:11   ` anon
2008-10-31 13:44     ` Robert A Duff
2008-10-31 17:24       ` anon
2008-11-01  8:39         ` Ludovic Brenta
2008-11-02  9:39           ` anon
2008-11-02 20:35             ` Ludovic Brenta
2008-11-03  4:50               ` anon
2008-11-01 22:04         ` sjw
2008-10-31 20:00 ` Thomas Locke

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