DIRECTORY deletion problem

9 messages Options
Embed this post
Permalink
Jimmy Johnson

DIRECTORY deletion problem

Reply Threaded More More options
Print post
Permalink
How do I delete a directory?  I tried:

                local
                        d: DIRECTORY
                do
                        create d.make (name_imp)
                        if d.exists then
                                d.recursive_delete
                        end
                end

but get an operating system error.

jjj

Jocelyn.Fiat.ES

Re: DIRECTORY deletion problem

Reply Threaded More More options
Print post
Permalink
It might help if you precise the platform, the version of your compiler
and eventually precise what are the name and access right of your folder

And which operating system error?

Otherwise, this is indeed a correct code.
You might want to add a rescue clause, in case the operating system had
any trouble removing some files.

-- Jocelyn


Jimmy J. Johnson wrote:

> How do I delete a directory?  I tried:
>
> local
> d: DIRECTORY
> do
> create d.make (name_imp)
> if d.exists then
> d.recursive_delete
> end
> end
>
> but get an operating system error.
>
> jjj
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
>  


--
Jocelyn
------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  

Jimmy Johnson

Re: DIRECTORY deletion problem

Reply Threaded More More options
Print post
Permalink
Windows XP
EiffelStudio 6 (6.3.7.6070 GPL Edition - windows)

Permission denied: Operating system error.

This directory was just created by this system.  Why do I not now have permision to delete it?

jjj



--- In [hidden email], "Jocelyn Fiat [ES]" <jfiat@...> wrote:

>
> It might help if you precise the platform, the version of your compiler
> and eventually precise what are the name and access right of your folder
>
> And which operating system error?
>
> Otherwise, this is indeed a correct code.
> You might want to add a rescue clause, in case the operating system had
> any trouble removing some files.
>
> -- Jocelyn
>
>
> Jimmy J. Johnson wrote:
> > How do I delete a directory?  I tried:
> >
> > local
> > d: DIRECTORY
> > do
> > create d.make (name_imp)
> > if d.exists then
> > d.recursive_delete
> > end
> > end
> >
> > but get an operating system error.
> >
> > jjj
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >  
>
>
> --
> Jocelyn
> ------------------------------------------------------------------------  
> Eiffel Software
> 805-685-1006
> http://www.eiffel.com       
> Customer support: http://support.eiffel.com       
> User group: http://groups.eiffel.com/join       
> ------------------------------------------------------------------------
>


Peter Gummer-2

Re: Re: DIRECTORY deletion problem

Reply Threaded More More options
Print post
Permalink
Jimmy J. Johnson wrote:

> Windows XP
> EiffelStudio 6 (6.3.7.6070 GPL Edition - windows)
>
> Permission denied: Operating system error.
>
> This directory was just created by this system.  Why do I not now  
> have permision to delete it?

On Windows, a common reason for not having permission to delete a file  
or directory is that some other process has it open.

- Peter Gummer
Jimmy Johnson

Re: DIRECTORY deletion problem

Reply Threaded More More options
Print post
Permalink
What process?  This system creates the directory with a file, writes to a file in the directory, and then closes it.


--- In [hidden email], Peter Gummer <p-gummer@...> wrote:

>
> Jimmy J. Johnson wrote:
>
> > Windows XP
> > EiffelStudio 6 (6.3.7.6070 GPL Edition - windows)
> >
> > Permission denied: Operating system error.
> >
> > This directory was just created by this system.  Why do I not now  
> > have permision to delete it?
>
> On Windows, a common reason for not having permission to delete a file  
> or directory is that some other process has it open.
>
> - Peter Gummer
>


Emmanuel Stapf

RE: Re: DIRECTORY deletion problem

Reply Threaded More More options
Print post
Permalink
Download the Process Explorer tools from http://tinyurl.com/ys2zq2 and there is a
way to find out which processes are using your files. Also make sure that you have
indeed permissions to delete the files.

Regards,
Manu

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Jimmy J. Johnson
> Sent: Friday, August 07, 2009 2:37 PM
> To: [hidden email]
> Subject: [eiffel_software] Re: DIRECTORY deletion problem
>
> What process?  This system creates the directory with a file, writes to a
> file in the directory, and then closes it.
>
>
> --- In [hidden email], Peter Gummer <p-gummer@...>
> wrote:
> >
> > Jimmy J. Johnson wrote:
> >
> > > Windows XP
> > > EiffelStudio 6 (6.3.7.6070 GPL Edition - windows)
> > >
> > > Permission denied: Operating system error.
> > >
> > > This directory was just created by this system.  Why do I not now
> > > have permision to delete it?
> >
> > On Windows, a common reason for not having permission to delete a file
> > or directory is that some other process has it open.
> >
> > - Peter Gummer
> >
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Jimmy Johnson

Re: DIRECTORY deletion problem

Reply Threaded More More options
Print post
Permalink
If I am interpreting what Process Explorer is telling me it apears as if my system is using a file in the directory I wish to delete.  So...

Is closing a file sufficiant to release any locks on it?  If so I must have not closed the file somewhere.  Is there anything else my system might be doing to hold the file [or directory]?

thanks,

jjj



--- In [hidden email], "Emmanuel Stapf [ES]" <manus@...> wrote:

>
> Download the Process Explorer tools from http://tinyurl.com/ys2zq2 and there is a
> way to find out which processes are using your files. Also make sure that you have
> indeed permissions to delete the files.
>
> Regards,
> Manu
>
> > -----Original Message-----
> > From: [hidden email]
> > [mailto:[hidden email]] On Behalf Of Jimmy J. Johnson
> > Sent: Friday, August 07, 2009 2:37 PM
> > To: [hidden email]
> > Subject: [eiffel_software] Re: DIRECTORY deletion problem
> >
> > What process?  This system creates the directory with a file, writes to a
> > file in the directory, and then closes it.
> >
> >
> > --- In [hidden email], Peter Gummer <p-gummer@>
> > wrote:
> > >
> > > Jimmy J. Johnson wrote:
> > >
> > > > Windows XP
> > > > EiffelStudio 6 (6.3.7.6070 GPL Edition - windows)
> > > >
> > > > Permission denied: Operating system error.
> > > >
> > > > This directory was just created by this system.  Why do I not now
> > > > have permision to delete it?
> > >
> > > On Windows, a common reason for not having permission to delete a file
> > > or directory is that some other process has it open.
> > >
> > > - Peter Gummer
> > >
> >
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>


Alexander Kogtenkov [ES]-2

Re: Re: DIRECTORY deletion problem

Reply Threaded More More options
Print post
Permalink
Jimmy J. Johnson wrote:

> Is there anything else my system might be doing to hold the file [or directory]?

If the directory to be deleted is the current working directory, it cannot be deleted as well.

Alexander Kogtenkov
Jimmy Johnson

Re: DIRECTORY deletion problem

Reply Threaded More More options
Print post
Permalink
It is not the current working directory; the file is in a directory which is under the current working directory.

Also, the explicit exception:
"Permission denied: Operating system error" with call stack:

file_unlink    RAW_FILE  FILE
delete         RAW_FILE  FILE
delete_content DIRECTORY DIRECTORY

This is on the call to file.delete at these lines from {DIRECTORY}.delete_content:

  if file.exists and then file.is_writable then
    file.delete
  end

Is this a problem with DIRECTORY or what am I missing?  If my file is still in use by some program [which I believe could only be the current system] then shouldn't `is_writable' return false?

jjj




--- In [hidden email], "Alexander Kogtenkov" <kwaxer@...> wrote:
>
> Jimmy J. Johnson wrote:
>
> > Is there anything else my system might be doing to hold the file [or directory]?
>
> If the directory to be deleted is the current working directory, it cannot be deleted as well.
>
> Alexander Kogtenkov
>