![]() |
Cannot delete zero byte files
This is doing my head in. I moved some files to the trash but I cannot empty them, getting a -35 error. Even as root I can't delete them as I'm informed they don't exist. An ls shows filenames but ls -l says they don't exist. rm -f doesn't work either. I've tried renaming, editing, moving. No dice. Can anyone offer a clue?
Thanks. Simon |
Bizzare - I wonder, does touching them do anything?
touch ~/.Trashes/fileordir rm -rf ~/.Trashes/fileordir |
Bizarre indeed. I wish touch was the answer, but I already tried that. I get the response "no match". They are long filenames because they were mp3s brought from another machine:
[localhost:.Trash/PeterMaffay/Live] root# ls Peter Maffay - Live Lange Schatten Tour 88 - 02. W??????-1.mp3 Peter Maffay - Live Lange Schatten Tour 88 - 02. W??????.mp3 I think the problem is partly that they originally had German characters in the filename - the "W??????" bit was originally "Wölfe". Basically the only command I've found that works on them is ls. ls -l says "no such file". I can't mv elsewhere. I can open them with vi and edit but not save them. I've never been in the situation where root was unable to remove files recursively. Curiouser and curiouser. |
What happens if you tab-complete one of the files? I don't think the ??? signs really are part of the name. It's just ls's way of displaying them. ö is often represented as \314\210 or some such. But when listed with ls it's shown as ??. It could be that your shell can tab-complete the filenames for you and that then you can rm them. Try with different shells, like tcsh, zsh and bash. I think that zsh could be the best bet.
|
Nope, that doesn't work :(
Tab complete shows exactly what you suggest, and I have previously tried this. Switching to zsh appears that it's going to allow deletion of the files. but the suckers are still there afterwards. |
assuming that the files are named Psomething<funnyChars>something ...
what does root# rm -i P* accomplish? not that this has nothing to do with permissions or root, but the squirrely chars to BSD. not too long ago, BSD had this sort of trouble with just spaces in a file name. [edit: root powers necessary] |
Truly curious. I too created a file named "Peter Maffay - Live Lange Schatten Tour 88 - 02. Wölfe-1.mp3" and had no problems stat:ing it. It lists (using bash and ls) as "Peter Maffay - Live Lange Schatten Tour 88 - 02. W??lfe-1.mp3" which is more like expected than your filenames. I begun with thinking it had to do with the file names, but I'm open for other causes now... Since you can't stat the files I guess you can't find out who's owning them? I know that some system calls demand that you own the file you are dealing with. Maybe you have a guess who the owner might be and then you could maybe try to tab-complete-delete them with zsh as that user?
|
rm -i P* achieves nothing:
root# rm -i P* rm: No match. As for ownership, with the two parent directories owned by myself (the user snc) I'm assuming the files are too. Nonetheless if I switch user from root it doesn't help with rm-tab-complete: snc% rm Peter\ Maffay\ -\ Live\ Lange\ Schatten\ Tour\ 88\ -\ 02.\ W??-1.mp3 rm: Peter Maffay - Live Lange Schatten Tour 88 - 02. W??-1.mp3: No such file or directory snc% rm Peter\ Maffay\ -\ Live\ Lange\ Schatten\ Tour\ 88\ -\ 02.\ W??.mp3 rm: Peter Maffay - Live Lange Schatten Tour 88 - 02. W??.mp3: No such file or directory snc% rm -i Peter\ Maffay\ -\ Live\ Lange\ Schatten\ Tour\ 88\ -\ 02.\ W??.mp3 rm: Peter Maffay - Live Lange Schatten Tour 88 - 02. W??.mp3: No such file or directory snc% rm -f Peter\ Maffay\ -\ Live\ Lange\ Schatten\ Tour\ 88\ -\ 02.\ W??.mp3 snc% ls Peter Maffay - Live Lange Schatten Tour 88 - 02. W??????-1.mp3 Peter Maffay - Live Lange Schatten Tour 88 - 02. W??????.mp3 |
it's the combination of spaces and squirrely chars.
remove the parent dir with extreme prejudice... root# rm -rf /path/to/dir if they're in /.Trashes ... root# rm -rf /.Trashes if they're on another volume ... root# rm -rf /Volumes/<volname>/.Trashes you get the idea. |
No, that's not it. If it were that simple I would never have needed to post the problem, unfortunately. Almost my first action was to try terminating the parent directory with extreme prejudice. I get this response, hence the problem:
[localhost:~snc/.Trash] root# rm -rf PeterMaffay/ rm: PeterMaffay/Live: Directory not empty rm: PeterMaffay: Directory not empty The occurs when trying to nuke the .Trash directory. That's the root of why I am so stumped. |
What about booting into OS 9, and deleting the files there?
|
Can't - I have no OS 9 stuff installed.
|
would you try the following? :
Code:
% /bin/ls -aiv1R ~/.Trash/have you rebooted to single-user mode and fsck'd that volume? |
root# /bin/ls -aivlR .Trash/
total 0 108026 drwx------ 3 snc staff 58 May 26 01:10 . 22703 drwxr-xr-x 27 snc staff 874 May 25 01:14 .. 88450 drwxrwxrwx 3 snc admin 58 May 25 16:32 PeterMaffay .Trash//PeterMaffay: total 0 88450 drwxrwxrwx 3 snc admin 58 May 25 16:32 . 108026 drwx------ 3 snc staff 58 May 26 01:10 .. 88451 drwxrwxrwx 4 snc admin 92 May 25 02:46 Live .Trash//PeterMaffay/Live: /bin/ls: Peter Maffay - Live Lange Schatten Tour 88 - 02. W??-1.mp3: No such file or directory /bin/ls: Peter Maffay - Live Lange Schatten Tour 88 - 02. W??.mp3: No such file or directory total 0 88451 drwxrwxrwx 4 snc admin 92 May 25 02:46 . 88450 drwxrwxrwx 3 snc admin 58 May 25 16:32 .. I've rebooted to single-user mode and run fsck -y. It fixed the filesystem (there was an error claiming an invalid leaf node number (or something similar - I've forgotten already). Still can't blow the files away though as I get the old "no such file" message. In single-user mode it tells me the files and directories are read-only, even though ls -l shows the directories as drwxrwxrwx. |
oh, and I have no /lost+found ....
|
Quote:
thanks for the lost+found report. i was going to ask for it again. that /bin/ls command that i requested? the switch is a "one" not an "ell" . could you try it again? ls -ivR -1 (one) .../Live/ and then i'll only need to see the interesting files. sorry about that vaguery. these fellers are really stubborn and i suspect they've got a control char in that spot after the "02. W" that doesn't expand in tabbed completion mode. some control char that has no business being in a filename, like backspace or something that alters the name of the file before interpretation. i would really like to get the magic incantation to constuct the filename that rm is going to pay attention to, but i suspect this is aggravating to you, so you let us know if you want us to keep monkeying. btw, do you have fink installed? there are some switches in GNU's ls command that could help grok those files. |
here's the output i'm looking for...
Code:
$ /bin/ls -ivR -1 foob/ |
OK, here goes, unfortunately it doesn't give anything we didn't get before:
root# /bin/ls -ivR -1 Live/ /bin/ls: Peter Maffay - Live Lange Schatten Tour 88 - 02. W??-1.mp3: No such file or directory /bin/ls: Peter Maffay - Live Lange Schatten Tour 88 - 02. W??.mp3: No such file or directory I'm very happy to keep monkeying around because what's aggravating is I really want to know what's causing this, and I want an empty Trash can without reinstalling the machine. No, I don't have fink installed. |
okay, then, what does:
Code:
% echo Live/*would you be willing to install a binary GNU ls if i sent it to you? [edit: consistancy of ls dir/*] |
root# echo Live/*
echo: No match. Yeah, sure I'll install that. Send it on over. |
oh, and I have no /lost+found ....
|
if you would email me your email address, i will send you a gzip'd GNU ls
see Author Info: below also, include your PATH variable, like so: # echo $PATH /Users/merv/bin:/sw/bin:/sw/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin i take it you're running the tcsh shell? |
which rm
Hunger Moon
Do you have an old fink installation. At one time a slightly broken rm was included in one of the file utilities packages. so try: Code:
[darwin:~] williamt% which rmWilly |
Looks to me like the files have been removed, but the directory entries still exist. Obviously this should not happen.
I would do the 9 boot to remove them (even if you have to boot from CD into 9). |
just for the record, I had the same problem with some Bjork MP3s, I think it has something to do with that dotted "o" when combined with coming over from a PC.
In any case, I got rid of the files by booting into OS9 and deleting them, though I think that was already suggested here.... |
thanks, mrdandy. we're looking for a command line solution. one should be able to create, move, and delete these file names in the shell.
stetner (hi doug); another user has reported this issue with files not yet in the trash. it's one of those 8-bit chars that changes the name of the file when its referenced. or it's a bugaboo in the core brainpan. think maybe an applescript could create a funky filename that shell would choke on? that's my approach, tho i'm loathe to do anything in AS (too cobol for me). this hinkyness will, most likely, be less of an issue in jaguar. |
Ok, lets break out the compiler and see what we can find 8-)
Code:
% cat dir_read.c Code:
cc -o dir_read dir_read.cCode:
% llDoug |
| All times are GMT -5. The time now is 06:17 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.