Re: extfs: make the open_archive stat() optional



Hello!

> Here is a patch that removes the need of the ':' within the extfs.ini and
> also handles the stat() failure conveniently.

This patch makes the code less reliable.  We know that some filesystems
always need a valid archive and some filesystems never need it.  There are
no filesystems that use an archive optionally.

Your patch derives the properties of the filesystem from the existence of
a file with a certain name.  That the wrong approach.  The properties of
an extfs filesystem are encoded in the corresponding script.

What if the archive disappears for some other reason?  What if the archive
name is used in an "archiveless" filesystem and that file happens to
exist?

The right solution would be to avoid mc_stat() in the "archiveless"
filesystems.

By the way, please don't use C++ comments in C code.

Answering your other e-mail, that's an example how to split the drive name
from path using sed:

#!/bin/sh
fullpath=/a/dos/format.com
drive=`echo $fullpath | sed 's,^/\([a-z]\)/.*$,\1,'`
path=`echo $fullpath | sed 's,^/[a-z]\(/.*\)$,\1,'`
if test -z "$drive"; then
    exit 1
fi
echo "drive=$drive"
echo "path=$path"

-- 
Regards,
Pavel Roskin



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