[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Minixfs and undeletable directories



Every now and then, somebody reports a file/directory on a minix
partition that they can't get rid of...

I recently ran into it myself while porting Python... I had a directory
that would not die.  Looking in the directory, I couldn't see
_anything_, it was empty as far as "ls" was concerned.

On my system (MiNT 1.12h4, minixfs 0.60pl11), I tend to do development
in my home directory; Python's source was unpacked in
/home/chris/src/Languages/Python-1.3 (which is 
/.minix/home/chris/src/Languages/Python-1.3, since I rename my TOS
drives).  /.minix is I:, and is a 256M partition, v2 minixfs with
64-character or 128-character filename limit, and 65k inodes.

The directory that would not die was .../Python-1.3/Lib/tkinter/matt or
something like that...  obviously, not long enough to overflow PATH_MAX
in "ls" or whatever.  So, I move the directory to /tmp (aka
/.minix/tmp), and it still appears empty... won't delete though 
(rm -rf).

So, I fire up Python, and type this in (from "An Introduction to Python
for UNIX/C Programmers" by Guido van Rossum, available on the web from
www.python.org):

import os
names = os.listdir( "." )
names.sort()
for n in names:
	print n

This just lists all the files/directories in the current directory.  I
run this in the undeletable directory, and lo and behold, there are a
whole bunch of files in there, with long (~30-40 char) filenames.  "ls"
can't see 'em, bash's filename completion can't seem 'em.  Bleh.

So I change the Python program a little:

import os
import posix
names = os.listdir( "." )
names.sort()
for n in names:
	print n
	posix.unlink( n )

Good-bye "invisible" files.  Now I can delete the directory.

So... what's up here?  "ident ls" says it's built with MiNTlibs pl 44;
did that have some bizarre limits to PATH_MAX or individual filenames?

-- 
----------========================================================----------
Chris Herborth, R&D Technical Writer       Arcane  Dragon     chrish@qnx.com
QNX Software Systems, Ltd.                  -==(UDIC)==-         |||  JAGUAR
http://www.qnx.com/~chrish/    DNRC Holder of Past Knowledge    / | \ 64-bit