From ligges at statistik.uni-dortmund.de  Mon Sep 22 22:55:03 2003
From: ligges at statistik.uni-dortmund.de (Uwe Ligges)
Date: Mon Sep 22 21:49:58 2003
Subject: [Rd] creates directory that can't be deleted (PR#4246)
References: <200309220026.h8M0QWJH012751@pubhealth.ku.dk>
Message-ID: <3F6F5397.65AFBCB8@statistik.uni-dortmund.de>

xiaobao_wang@yahoo.com wrote:

> Full_Name: Xiaobao Wang
> Version: R 1.7.1
> OS: Windows XP
> Submission from: (NULL) (24.45.25.102)
> 
> 
> accidentally done the following:
> 
> rpt.dir <- paste("c:/report/testR","bestsub",spe="/")
> dir.create(rpt.dir)
> 
> (spe should be sep).  Now the directory "c:/report/testR bestsub " cannot be
> removed.  I tried to remove it from Windows Explorer and got the message box:
> =================================================================
> Error Deleting file or folder:
>    Cannot delete file: Cannot read from source file or disk
> 


Hmmm. Strange. Since nobody else has answered up to now, here's a not
very promising answer:
I've got an unremovable directory now, too. Maybe I can take a closer
look tomorrow how to remove such files/directories on Windows. My first
guess was cygwin might help, but that seems not to be the case. Another
idea is to implement a remove-function in low level in the way the
directory was created (not sure whether that will work). I don't have
any further idea, except for using special tools to work directly on the
file system tables (don't do that!).

I thought Windows denies the creation of files (directories) with names
you cannot access later. From my point of view, this is a Windows bug,
not a bug in R [hence replied to r-devel]. Your report can be regarded
as a wishlist entry for working around the windows bug, so that
dir.create() and friends will report an error when trying to create
not-allowed names (presumably nobody is going to implement it, though).

Uwe Ligges


[Rd] creates directory that can't be deleted (PR#4246)
Uwe Ligges