comp.lang.ada
 help / color / mirror / Atom feed
* RE: rename missing in Text_IO
@ 2001-05-04 20:50 Beard, Frank
  2001-05-04 21:08 ` Pascal Obry
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Beard, Frank @ 2001-05-04 20:50 UTC (permalink / raw)
  To: 'comp.lang.ada@ada.eu.org'

But why not be part of the standard, maybe in an Annex.  I
almost sympathize with what Ted's saying.  But by his reasoning,
Ada.Command_Line shouldn't be provided either, because the OS
has an interface to do it.  For that matter, none of the IO should
be there because we could pragma interface to all those routines.

I would love to see file handling expanded.  Renaming a file
should be there just as the Delete is there.  Why not have all
the common file operations available.  I think you should be able
to do locking, file or record, from within the language standard.
Getting a directory list should be there too.

Frank

-----Original Message-----
From: Ted Dennison [mailto:dennison@telepath.com]
Sent: Friday, May 04, 2001 9:43 AM
To: comp.lang.ada@ada.eu.org
Subject: Re: rename missing in Text_IO


In article <3af28c5a.12778070@news.nl.uu.net>, Noam Kloos says...

>I just played with filtering some textfiles and found there is no
>function to rename a file;

That's right. There's no function to delete a file, or list a directory
either.
That's all stuff that's considered part of the OS, and thus you are expected
to
make the appropriate OS calls for your platform. Most of the time, your Ada
vendor will have supplied a package that has bindings to those OS calls, but
what it is depends on your vendor and platform.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com
_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/mailman/listinfo/comp.lang.ada




^ permalink raw reply	[flat|nested] 25+ messages in thread
* RE: rename missing in Text_IO
@ 2001-05-09 22:56 Beard, Frank
  0 siblings, 0 replies; 25+ messages in thread
From: Beard, Frank @ 2001-05-09 22:56 UTC (permalink / raw)
  To: 'comp.lang.ada@ada.eu.org'


-----Original Message-----
From: Fraser Wilson [mailto:blancolioni@blancolioni.org]

>> But if what we are considering is what an Ada Library Package 
>> should look like, then there's no reason to copy the low level 
>> features of an operating system.  And the semantics of the mv 
>> command is generally superior.  A program should not need to 
>> know the details of the disk layout. 

> The problem is that a rename or move on the same disk is significantly
> cheaper than one that crosses disks.  It's also a much safer
> operation.

So what?  If I need to move it to another disk, then I need to move
it to another disk.  I don't think the cost would be the issue in that
case.  If cost is the issue, which would be determined either by 
prototyping or performance testing, then keep it on the same disk.

> I think the implementation detail line is quite fuzzy here.

POSIX figured it out in some reasonable manner.

> More generally, the destination might not even be a disk filesystem;
> it could be a remote ftp site or /proc on Linux.  Does a move/rename
> even make sense in those cases?

You wouldn't be using the move/rename in this case anyway, would you?
Probably an RPC command, which is another Annex for discussion.

Frank




^ permalink raw reply	[flat|nested] 25+ messages in thread
* Re: RE: rename missing in Text_IO
@ 2001-05-07 19:00 Marin David Condic
  2001-05-08  4:38 ` tmoran
  0 siblings, 1 reply; 25+ messages in thread
From: Marin David Condic @ 2001-05-07 19:00 UTC (permalink / raw)


"Ted Dennison" <dennison@telepath.com> wrote in message
news:BrBJ6.4787$vg1.374667@www.newsranger.com...
> My current favorite trick is to just raise a single "Foo.Error" exception
for
> any C error condition in each package. There are obviously some situations
where
> this would be undesirable, but you'd be suprised how often its sufficient.
> Sometimes when extra info might be in order for diagnosis, it can just be
put
> into the execption message.
>
It might work nicely enough to get the job done. If a function was provided
to return a more detailed error code (the actual return status of the C
function?) that might be enough to get the job done cleanly.


> Yeah, it would all need to interoperate. That's part of why I wanted to
fob the
> job off on someone else. My bindings aren't really that good for a base
right
> now, since a lot of basic Win32 stuff that everyone is liable to use isn't
there
> (with the notable exception of process id's).
>
Its always nicer if you can get someone else to do all the work! :-) I don't
have an easy answer for this other than possibly someone has/had a corporate
need to build the bindings anyway & are willing to give it away.


> Nearly all of that crap in Gnat's Win32 package is special String and Void
> pointer types that I never pass back to the user anyway. :-)
>
> The problem with doing things this way is that when you abstract away some
of
> the C cruft, a lot of that organization doesn't make any sense. For
instance,
> the Windows NT/2K "performance data" that you need to parse to get stuff
like a
> what executable a process is using, is entirely accomplished using
registry
> calls. But if abstracted down to something like
> Get_Executable_Name (Process.ID)
>
Two issues: One is that the Win32ada bindings are not specific to Gnat. They
exist in Aonix as well (& Maybe RR?) & I think they were originally a
product of Averstar - so they're pretty much a common thing. I'm sure you
know this, but given the way you phrased the statement above, it might not
have been clear to someone just now approaching it. (It wouldn't be fair to
blame Gnat for the fact that the Win32api is a turd that no matter how long
you polish it will always remain a turd!)

The other thing is to remember that the whole Win32api was organically grown
at Micro$oft (probably in a damp basement with no light) so it is enormously
internally inconsistent. No getting around that - its someone else's dirty
work. I like abstracting things and have done so with the Winsock calls in
particular. The only problem is that then you're heading off into a much
thicker binding and where do you stop? I'd rather just go with something
like Claw if I wanted to get further away from the absurdities of Win32api.
For some uses, it may be fine just to get a step away from the C-isms of the
Win32api.


> Then it doesn't make much sense to put this call in a "Registry" package.
>
> Another issue is that a lot of times the original C libraries aren't very
well
> organized in the first place. For instance, the Win32 process and thread
stuff
> is stuck into a huge 8 thousand line header file along with basic File
I/O,
> serial I/O, process syncronization stuff like pipes and mailslots and
> semaphores, object priveleges and ACLs, computer and user names, etc. My
current
> bindings just have a single "Process" package for Win32 processes. I don't
think
> I'd want to make a Win32.Base_Services package and put all that crap into
it.
>
As I said - Win32api is a turd. However, your your proposal of consolidating
some of this stuff (wise as it may be) leaves open the question of how thick
a binding do you want to construct? I'd reiterate that it might make sense
to simply have something that was one-step away from the really crappy
C-isms in the Win32ada collection. (At least it would be familiar & would
parallel existing Win32api documentation.) Beyond that another layer of
abstraction may be in order to simplify things in some manner. But that's
just rebuilding Claw. Where do you want to draw the line and say "This far
and no farther?"

> Generally I try to stick to Strings, Integers, private types, and the odd
> enumeration here or there. But some specific guidlines would indeed be
required,
> or I'm afraid I'd spend all my time redesigning submissions. Ick.
>
I agree. Where possible, use the standard types insofar as they align with
the sizes required by the actual calls. Usage of Integer, Float,
(Long_Integer, Long_Float, etc.) Character & String should handle 99% of
everything - probably with some enumerations & exceptions to cover return
statuses. Maybe some hiding of structs within private types makes sense. One
might want to construct some primitive types (Integer_32, Float_64?) just to
guarantee sizes and the overridability of operations.

Maybe an example or two would suffice as a guideline? "Make it look like
this!"

MDC


--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/






^ permalink raw reply	[flat|nested] 25+ messages in thread
* RE: rename missing in Text_IO
@ 2001-05-07 17:01 Beard, Frank
  0 siblings, 0 replies; 25+ messages in thread
From: Beard, Frank @ 2001-05-07 17:01 UTC (permalink / raw)
  To: 'comp.lang.ada@ada.eu.org'

Yes, I realize that, but you're talking about a system dependency
which is a separate issue from the logical operations.  I don't
remember that limitation on VMS, but I haven't been on that OS in
twelve years.

But, if that is the case, then the operation would simply raise 
something like USE_ERROR to indicate a problem.  The developer on that
OS would need to know the system well enough to know that limitation.

And just because it varies doesn't mean it shouldn't be done.  The
Posix binding for VMS had a rename in it.  I hate to keep going back
to the same example, but the same argument can be made, and was made,
for Ada.Command_Line.  It varies from system to system, and doesn't
even exist on some.


-----Original Message-----
From: Kilgallen@eisner.decus.org.nospam

Unlike Delete, the legality of Rename is going to vary from operating
system to operating system.  If you rename into a different directory
on VMS, that directory must be on the same physical disk.  With rooted
directories, begin on the same disk is not obvious by comparing the old
and new filespecs.

_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/mailman/listinfo/comp.lang.ada




^ permalink raw reply	[flat|nested] 25+ messages in thread
* RE: rename missing in Text_IO
@ 2001-05-04 21:48 Beard, Frank
  0 siblings, 0 replies; 25+ messages in thread
From: Beard, Frank @ 2001-05-04 21:48 UTC (permalink / raw)
  To: 'comp.lang.ada@ada.eu.org'

I totally agree!
Frank

-----Original Message-----
From: Pascal Obry [mailto:p.obry@wanadoo.fr]
Sent: Friday, May 04, 2001 5:08 PM
To: comp.lang.ada@ada.eu.org
Subject: Re: rename missing in Text_IO



"Beard, Frank" <beardf@spawar.navy.mil> writes:

> I would love to see file handling expanded.  Renaming a file
> should be there just as the Delete is there.  Why not have all

Note that Delate is there but taking a File_Type as argument. Do you really
want to open the file to be able to delete it ? I would say no in the
general
case and we really need a Delete/Rename with a string argument.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"
_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/mailman/listinfo/comp.lang.ada




^ permalink raw reply	[flat|nested] 25+ messages in thread
* rename missing in Text_IO
@ 2001-05-04 11:04 Noam Kloos
  2001-05-04 13:43 ` Ted Dennison
  0 siblings, 1 reply; 25+ messages in thread
From: Noam Kloos @ 2001-05-04 11:04 UTC (permalink / raw)


Hi,

I just played with filtering some textfiles and found there is no
function to rename a file;

Noam Kloos.



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

end of thread, other threads:[~2001-05-10 13:16 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-04 20:50 rename missing in Text_IO Beard, Frank
2001-05-04 21:08 ` Pascal Obry
2001-05-04 21:21 ` Ted Dennison
2001-05-05 21:19   ` Keith Thompson
2001-05-07  8:56   ` Noam Kloos
2001-05-04 23:38 ` Larry Kilgallen
2001-05-04 23:17   ` David Starner
2001-05-08 22:03     ` Charles Hixson
2001-05-08 23:51       ` David Starner
2001-05-09 16:22         ` Charles Hixson
2001-05-09 22:04           ` Fraser Wilson
2001-05-09 22:33             ` Charles Hixson
2001-05-10 13:16             ` Ted Dennison
  -- strict thread matches above, loose matches on Subject: below --
2001-05-09 22:56 Beard, Frank
2001-05-07 19:00 Marin David Condic
2001-05-08  4:38 ` tmoran
2001-05-08 13:16   ` Marin David Condic
2001-05-09 13:10     ` Stephen Leake
2001-05-09 14:44       ` Marin David Condic
2001-05-10  4:39         ` tmoran
2001-05-07 17:01 Beard, Frank
2001-05-04 21:48 Beard, Frank
2001-05-04 11:04 Noam Kloos
2001-05-04 13:43 ` Ted Dennison
2001-05-04 13:53   ` Noam Kloos
2001-05-04 15:39     ` Ted Dennison
2001-05-04 14:00   ` Noam Kloos
2001-05-04 21:15     ` Florian Weimer

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