comp.lang.ada
 help / color / mirror / Atom feed
* Problem Deleting files & the USE_ERROR exception & WHY
@ 2001-01-21 16:04 squeaker
  2001-01-21 17:00 ` Robert Dewar
  2001-01-21 18:15 ` Nick Roberts
  0 siblings, 2 replies; 4+ messages in thread
From: squeaker @ 2001-01-21 16:04 UTC (permalink / raw)


I am currently using tasks to perform some file operations. Now I am having
a real problem in actually deleting a file at the current time... I am
opening the file i wish to delete which is performed successfully, I then
try to delete the file and it comes up with the io_exception use_error. Now
i am 99% sure that the file wasnt already open by another task, so I am
really puzzled as to what else can actually cause a use error, and is there
actually a certain amount of time that the program should wait after the
file was closed before it can re-open it and then delete it? and just to
comfirm, you dont have to close the file once you have deleted it right?
because theres nothing to close once its been deleted ???

Help would be appreciated, Thanks

Rich





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

* Re: Problem Deleting files & the USE_ERROR exception & WHY
  2001-01-21 16:04 Problem Deleting files & the USE_ERROR exception & WHY squeaker
@ 2001-01-21 17:00 ` Robert Dewar
  2001-01-21 18:15 ` Nick Roberts
  1 sibling, 0 replies; 4+ messages in thread
From: Robert Dewar @ 2001-01-21 17:00 UTC (permalink / raw)


In article
<ORDa6.8829$vH6.140011@news6-win.server.ntlworld.com>,
  "squeaker" <squeaker@ntlworld.com> wrote:
> just to comfirm, you dont have to close the file once you
> have deleted it right? because theres nothing to close once
> its been deleted ???

Right conclusion, bogus reasoning. The internal file does not
go away as a result of doing something to the external file,
so it most certainly must be closed, but if you read the RM

        13   Deletes the external file associated with the
             given file.  The given file is closed, and the
             external file ceases to exist.

It is 100% clear in plain language that the delete does the
necessary close operation.

Please use the RM as a reference source for such matters.
Especially when it comes to Annex A, it is easy to read, and
a whole lot more reliable than random answers on CLA :-)

As for the rest of your question, there is inadequate data
to even guess what might be the problem.


Sent via Deja.com
http://www.deja.com/



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

* Re: Problem Deleting files & the USE_ERROR exception & WHY
  2001-01-21 16:04 Problem Deleting files & the USE_ERROR exception & WHY squeaker
  2001-01-21 17:00 ` Robert Dewar
@ 2001-01-21 18:15 ` Nick Roberts
  2001-01-21 18:55   ` Robert Dewar
  1 sibling, 1 reply; 4+ messages in thread
From: Nick Roberts @ 2001-01-21 18:15 UTC (permalink / raw)


Rich,

Use_Error is a bit of a catch-all exception, raised whenever you try to do
something with a file that goes wrong for any of a hundred possible reasons.

Something may be making it illegal for you to delete the (external) file,
such as you do not have permission to delete it, it is being held open by
another program, or it is fundamentally undeletable (e.g. a device).

Alternatively it may simply be that your Ada implementation is not actually
able to delete files, or that your Ada implementation gets confused if you
try to do things to the same (internal) file with different tasks. These
kinds of limitations should be documented in your Ada's documentation.

Try to check out these possibilities. If you are still baffled, tell us all
the circumstances of your problem, including which Ada compiler and its
version, which operating system and its version, what kind of file and
details about the file. Include the relevant parts of your Ada code (but not
too much). Also tell us what you are basically trying to do with your
program.

Best of luck,

--
Nick Roberts
http://www.AdaOS.org






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

* Re: Problem Deleting files & the USE_ERROR exception & WHY
  2001-01-21 18:15 ` Nick Roberts
@ 2001-01-21 18:55   ` Robert Dewar
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Dewar @ 2001-01-21 18:55 UTC (permalink / raw)


In article <94f9qg$dc4s7$2@ID-25716.news.dfncis.de>,
  "Nick Roberts" <nickroberts@callnetuk.com> wrote:
> Alternatively it may simply be that your Ada implementation
> is not actually able to delete files, or that your Ada
> implementation gets confused if you try to do things to the
> same (internal) file with different tasks. These
> kinds of limitations should be documented in your Ada's
> documentation.

Doing things with the same file from different tasks without
synchronization is of course erroneous. It is not a
"limitation" for Ada compilers to do X for erroneous
executions (and this is true for all possible X), so you
should NOT expect to find this particular "limitation"
in the documentation, and if this is what you are doing,
then all bets are off!


Sent via Deja.com
http://www.deja.com/



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

end of thread, other threads:[~2001-01-21 18:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-21 16:04 Problem Deleting files & the USE_ERROR exception & WHY squeaker
2001-01-21 17:00 ` Robert Dewar
2001-01-21 18:15 ` Nick Roberts
2001-01-21 18:55   ` Robert Dewar

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