l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
November 4: Social gathering
Next Installfest:
TBD
Latest News:
Oct. 24: LUGOD election season has begun!
Page last updated:
2004 May 21 13:29

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Removing Files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Removing Files





--On Friday, May 21, 2004 11:48:16 +0000 Tim Riley <timriley@timriley.net> wrote:

<snip>
> r = 114
>  = 4294967220
This character is suspicious. It's supposed to be 39, so
apparently there are colors or other attribute information
embedded.
The actual character code is 180 decimal, which is an acute accent in the latin1 (or ISO8859-1) character set. You're getting 4294967220 because of a bug in the program. ptr points to signed characters so 180 is interpreted as -76; when *ptr is passed to printf(), the value is sign-extended to a signed int and then printed as if it were unsigned.

But none of this really matters. When you get a filename from readdir(), you should be able to call unlink() on that string and refer to the same file. Funny high-bit characters in the string shouldn't be an issue at this level. Certainly running "rm -r" on the directory containing the file should have worked.

Daniel, the test program you posted actually copies the filename string into another buffer usint sprintf(). I don't think *printf() is supposed to do character-set conversions, but maybe it does. Try using strcat() to construct the pathname for deletion, or else just chdir() into the directory containing the file and call unlink() on the contents of the d_name buffer.

If this doesn't work, then it seems to me you have filesystem corruption, despite the fact that fsck didn't find anything to fix. You might have to resort to something drastic like:

1) Become root.
2) Unlink the directory containing the file (see rm's "-d" or "--directory" option).
3) Unmount the filesystem and fsck it.

--
"Grand Funk Railroad paved the way for Jefferson Airplane, which cleared
the way for Jefferson Starship. The stage was now set for the Alan Parsons
Project, which I believe was some sort of hovercraft." - Homer Simpson

Kenneth Herron Kenneth.Herron@mci.com v658-5894 916-569-5894

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.