Undeletable file in cygwin

The command I ran in cygwin collected a bunch of files. Now I can not delete them. Omitting most of the output of "ls", here is what I mean:

% ls -l ls: cannot access WSERV001.txt: No such file or directory -rw-r--r-- 1 mccppk mkgroup-ld 50 Sep 17 16:57 WSERV001.text ??????????? ? ? ? ? ? WSERV001.txt % rm WSERV001.txt rm: cannot remove `WSERV001.txt': No such file or directory % touch WSERV001.txt touch: cannot touch `WSERV001.txt': Permission denied 

The .text file is normal. The .txt file (recording anyway) is clearly closed. Any ideas on how to delete the .txt file?

+6
cygwin
source share
4 answers

Attempts to use chown and chmod, even as root, failed (I do not remember the error).

I am sure my drive is in order. I run DiskCheckup daily for a strong SMART configuration history and tested it this morning. Do not worry.

Since the original problem and the message were busy, I just returned to the same local shell window. These files have disappeared. It was a local cygwin shell on my laptop, so I know that no one else "helped." It’s strange. Those .txt files were no longer there.

I'm still wondering what might cause ls to output all such question marks as this for all file metadata except the file name. But the main problem is solved.

0
source share

I had the same problem and fixed it as follows (under Win7):

Open cmd windows (run as Administrator)

takeown / r / f DRIVE: \ PATH

icacls DRIVE: \ PATH / grant USERNAME: F / T

where USERNAME is your win7 username under which you are doing this.

Also make sure that cron.exe does NOT start for the USERNAME or SYSTEM user (you can check from the TaskManager) and that no programs from cygwin are running.

Once everything is verified and completed, you can delete your files.

Hope this helps,

Jean

+11
source share

I have a reproducible case, and none of the ones suggested here help due to permission restrictions.

In sygwin:

 [ Sakis@t0000000000 ]$ ll total 0 drwxr-x--- 1 ???????? ???????? 0 Jul 4 02:51 t0000000000_1.db/ [ Sakis@t0000000000 ]$ 

Trying to take ownership from admin cmd console:

 c:\t000000000 0>takeown /r /f t0000000000_1.db ERROR: Access is denied. 

Trying to remove admin cmd from the console:

 c:\t000000000 0>rmdir /S t0000000000_1.db t0000000000_1.db, Are you sure (Y/N)? Y Access is denied. 

Unable to change ownership from Windows GUI. He complains that you must have read permissions.

--- RESOLVED ---

Finally, I was able to remove it by entering the cmd command with administrative privileges and run:

 rm -r <dir> 

TIP. You must make sure that the directory is not used at all. You can use procmon to find you, which blocks this directory.

+5
source share

As an administrator, this should fix it:

 chown <yourusername> WSERV001.txt chmod 666 WSERV001.txt rm -f WSERV001.txt 

If not, there may be errors on the disk.

0
source share

All Articles