Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
I have tried everything to delete this file
Renaming
Terminal (rm -rt)
nothing works...Can anybody help?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Are there any other .html files you need to keep in the same directory? If not rm *.html would likely work. Why can't you delete it? Permission denied or you can't get the system to accept the filename?
 

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
every time you try to rename it, it will not let you and
an unexpected error occurred (error code -43) appears
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
In the worst-case scenario, you should be able to move anything of value in the directory and any subdirectories then rm -rf the containing directory. I doubt even a very wily file would have the skills to prevent the directory it's in from being blasted.

Another tact might be to rename it. That may be tough, but the first letter seems pretty standard. You might try to just type:
mv Ti<tab>
and see if tab completion gives you a nicely escaped filename. If so, just type an easier filename as the second argument and hopefully it will be moved successfully.

If things get particularly dire using find with an exec directive might work, but I can't say so for sure.

-Lee
 

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
I've tried both options above and still no luck
the rm -rf states:
rm: illegal option -- /
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
and
renaming it anything wont work it just gives you the error message
(error code -43)
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
Whenever I have to remove a file with a name the shell doesn't recognize, I have to include the directory it's as as argument to rm, as such:

rm -f ./*.html

Assuming you don't mind blowing away any other html files in that directory, does that line work?

The (-43) error is most likely the value of the shells 'errno' variable. You can look it up in /usr/include/errno.h to see what 43 maps to. It can vary from system to system, but on Linux I see:

...
#define EIDRM 43 /*Identifier Removed*/
...
 

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
Thanks - tried it and it still does not get rid of the file
 

Sayer

macrumors 6502a
Jan 4, 2002
981
0
Austin, TX
-43 is a fine not found error.

You should run Disk Utility and verify the hard drive. You prolly have some bad data on the disk.

If you have any Mac OS X disc, or the discs that came with the Mac boot from one and run Disk Utility to repair the drive.
 

HiRez

macrumors 603
Jan 6, 2004
6,250
2,576
Western US
Why not move everything else in that folder into a temporary folder, then delete the whole folder, create a new one, and move the old stuff back. But I agree with Sayer, verify the disk and permissions first.
 

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
Thank for all your help, but this file is not going anywhere.
The file "Tiếng Việt.html" is in it's own folder called "Legal"
I can delete the whole folder but then it just sits in the trash
and will not permanently delete, it will just stay in the trash
all other items in the trash get deleted but this folder will not go

Any other ideas?
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
Thank for all your help, but this file is not going anywhere.
The file "Tiếng Việt.html" is in it's own folder called "Legal"
I can delete the whole folder but then it just sits in the trash
and will not permanently delete, it will just stay in the trash
all other items in the trash get deleted but this folder will not go

Any other ideas?

What are the ownership and permissions of the parent Legal directory? If you do an

ls -l Legal

who's are they owned by and is the sticky bit set (a 't' at the end)? If it the sticky bit is set, even if you have write permission to the directory, if the .html file isn't owned by you won't be able to delete it.

Just sudo to root and try removing it then.
 

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
This is what I get when I try ls -1 Legal
lb0004:~ sandymartinez$ ls -1 legal/Users/sandymartinez/Desktop/Legal.rtf/
ls: legal/Users/sandymartinez/Desktop/Legal.rtf/: No such file or directory

I dont know what sudo to root is?

Thanks for all your help, but I guess Im just going to have to
live with this file in the trash.:apple:
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
This is what I get when I try ls -1 Legal
lb0004:~ sandymartinez$ ls -1 legal/Users/sandymartinez/Desktop/Legal.rtf/
ls: legal/Users/sandymartinez/Desktop/Legal.rtf/: No such file or directory

I dont know what sudo to root is?

You want to type ls -l (the letter 'l', not the number '1') to get the full listing with permissions, so type as shown:

ls -ld ~/Desktop/Legal.rtf

ls -l ~/Desktop/Legal.rtf


This prints out the directory and file permission bits. Post them here when you're done.

Sudo'ing to root means switching to the root user, where you enjoy omnipotent godlike privileges on your system. You can remove the file as root in one shot by typing:

sudo rm -R /Users/sandymartinez/Desktop/Legal.rtf

I left off the 'f' option here so rm will prompt you to make sure you want to delete (this protects you in case you put a space between '/' and 'Legal.rtf', which would otherwise blow away your entire desktop..every UNIX user has accidentally done this to their horror sometime in their lives). Unless some process has the contents of this file memory mapped (which I doubt), this will remove the file.
 

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
You want to type ls -l (the letter 'l', not the number '1') to get the full listing with permissions, so type as shown:

ls -ld ~/Desktop/Legal.rtf

ls -l ~/Desktop/Legal.rtf


This prints out the directory and file permission bits. Post them here when you're done.

Sudo'ing to root means switching to the root user, where you enjoy omnipotent godlike privileges on your system. You can remove the file as root in one shot by typing:

sudo rm -R /Users/sandymartinez/Desktop/Legal.rtf

I left off the 'f' option here so rm will prompt you to make sure you want to delete (this protects you in case you put a space between '/' and 'Legal.rtf', which would otherwise blow away your entire desktop..every UNIX user has accidentally done this to their horror sometime in their lives). Unless some process has the contents of this file memory mapped (which I doubt), this will remove the file.

Code:
lb0004:~ sandymartinez$ ls -ld ~/Desktop/Legal.rtf
drwxrwxrwx   3 sandymar  admin  102 Jun  5 13:35 /Users/sandymartinez/Desktop/Legal.rtf
lb0004:~ sandymartinez$ ls -l ~/Desktop/Legal.rtf
ls: Tiếng Việt.html: No such file or directory
lb0004:~ sandymartinez$ sudo su
lb0004:/Users/sandymartinez root# rm -R /Users/sandymartinez/Desktop/Legal.rtf
rm: /Users/sandymartinez/Desktop/Legal.rtf/Tiếng Việt.html: No such file or directory
rm: /Users/sandymartinez/Desktop/Legal.rtf: Directory not empty
lb0004:/Users/sandymartinez root#
 

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
Silly question, but have you tried rebooting after placing the file (or entire directory) in the Trash, then after restart, emptying the Trash?

Another utility that's never failed for me is SuperEmptyTrash.

I have tried to reboot and it still will not delete
Also just tried your SuperEmptyTrash and it wont get rid of the files either
it says the directory is not empty
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
You either have a corrupted inode or (more likely) the Tieng file has non-printable characters in the file name.

If you go into the Legal.rtf directory and type in

rm -f *Ti*

does that remove it?
 

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
You either have a corrupted inode or (more likely) the Tieng file has non-printable characters in the file name.

If you go into the Legal.rtf directory and type in

rm -f *Ti*

does that remove it?

How do you get into the directory?
 

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
cd /Users/sandymartinez/Desktop/Legal.rtf

still does not remove it

lb0004:~ sandymartinez$ cd /users/sandymartinez/desktop/legal.rtf
lb0004:/users/sandymartinez/desktop/legal.rtf sandymartinez$ rm -f*ti*
rm: illegal option -- *
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
 

SURF2DY

macrumors newbie
Original poster
Jun 4, 2008
21
0
you need to put a space between the 'f' and the first '*', and use a capital 'T', exactly as so:

rm -f *Ti*

Noted, but I have tried it both ways and it still does not get rid of the file
lb0004:~ sandymartinez$ sudo su
Password:
lb0004:/Users/sandymartinez root# cd /users/sandymartinez/desktop/legal.rtf
lb0004:/users/sandymartinez/desktop/legal.rtf root# rm -f *Ti*
lb0004:/users/sandymartinez/desktop/legal.rtf root#
and w/out sudo to root
lb0004:~ sandymartinez$ cd /users/sandymartinez/desktop/legal.rtf
lb0004:/users/sandymartinez/desktop/legal.rtf sandymartinez$ rm -f *Ti*
lb0004:/users/sandymartinez/desktop/legal.rtf sandymartinez$
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.