Re: [Nautilus-list] Directory Descriptions (Was: I am going toimplement cut, copy,paste forfiles)



On Thu, 22 Mar 2001, Matthew Walton wrote:

> I'm throwing stuff around randomly here because I don't know all that much about the
> performance issues related to XML parsing and so forth, but wouldn't it be better to
> have a central directoryinfo file that had entries for each directory complete with
> their paths? Thus:
>
> <?xml version="1.0"?>
> <DirectoryInfoList>
>         <DirectoryInfo path="/etc">
>                 <title>Configuration files</title>
>                 <icon>/usr/share/icons/directoryicons/etc.xpm</icon>
>                 <hideinlevel>novice</hideinlevel>
>         </DirectoryInfo>
> ... (and so on)
> </DirectoryInfoList>

A central directoryinfo file is also a possible idea.

>
> However, I can see problems with this:
> 1) how do you generate the file to start with? Get the user to enter all the paths at
> first run? Don't think so somehow...

In general these are created by the nautilus developers for the C locale
and the translators make their own $LANG translation.
On this issue there is not problem.

> 2) you've still got the problem of reading the thing and checking every single
> directory against it to see if it should be displaying special info for it
> Although a possible solution might be to shove a tiny weeny little file with no
> useful information at all in it in each directory that has an entry in the global
> info file, so when Nautilus finds that it knows to go look in the main file for the
> info. Of course, this could still cause performance problems, not to mention
> inefficiency of storing small files on some file systems.

Typically, as you add more user-friendly features, you always get such
performance problems. A solution would be to limit the directories listed
to around 20 (listed below) and keep the structure in memory. When the
directories are listed in Nautilus, a hook will check if there is a
description for them.

Important directories could be (RH 7.0 oriented):

/		Root directory
/bin		Basic commands
/boot		Boot files
/dev		Devices (inherit)
/etc		Configuration files (inherit)
/etc/X11	X11 configuration files (inherit)
/etc/cron.*	Configuration files for scheduled tasks
/etc/init.d	Scripts to manage services
/etc/rc*	Scripts to manage services in runlevels
/etc/sysconfig	System configuration files (inherit)
/etc/httpd	WWW server configuration files (inherit)
/home		User home directories
/lib		Basic library files
/lib/modules	Kernel module files (inherit)
/lost+found	Crash recovery directory
/mnt		Mounted partitions
/opt		Optional packages
/proc		Kernel interface directory
/root		Administrator's directory
/sbin		Basic system commands
/tmp		Temporary files directory
/usr		User utilities directory
/usr/local/	Local system directory
/usr/...
/var		...

The definitive source for descriptions is the "Filesystem Hierarchy
Standard" page at "http://www.pathname.com/fhs/";.
If there is interest for a solution like this, I could do the
initial full .xml files.

Finally, there should be a
	<inherit>yes</inherit>
designation for directories such as /etc that have plenty of
subdirectories.

simos

(For the future, there could be a rule to match the name
of the directory, such as: "lost+found", irrespective of
the location of the directory. There should be a warning
that such a directory should better not be erased and
that if one simply does a "mkdir" to recreate it, it is not
the same... Perhaps "lost+found" should be shown for "expert only".)

(Additionally, the /home/* directories could have a "%s's home directory"
description and %s should be the gecko (or username) field in the password
file).

> Simos Xenitellis wrote:
>
> > I assume to implement this properly, a special .directoryinfo file should
> > be put in the designated directories that has some ID to a description of
> > the  purpose of that directory.
> >
> > Since XML is so trendy, that .directoryinfo file could like like:
> >
> > /etc/.directoryinfo:   (possibly: /etc/.directoryinfo.xml) ?
> > <?xml version="1.0"?>
> > <DirectoryInfoList>
> >     <title>Configuration files</title>
> >     <icon>/usr/share/icons/directoryicons/etc.xpm</icon>
> >     <hideinlevel>novice</hideinlevel>
> >     ... (perhaps some more info)
> > </DirectoryInfoList>
> >
> > However, since
> >         - people do not only speak english
> >         - it's bad to scatter translatable strings in all the
> >           filesystem,
> >
> > another scheme may look better:
> >
> > a) /etc/.directoryinfo
> > <?xml version="1.0"?>
> > <Directory>
> >         <ID>main_configuration_files</ID>
> > </Directory>
> >
> > b) /usr/share/directoryinfos/C/directoryinfo.xml
> > <?xml version="1.0"?>
> > <DirectoryInfoList>
> >         <DirectoryInfo ID="main_configuration_files">
> >                 <title>Configuration files</title>
> >                 <icon>/usr/share/icons/directoryicons/etc.xpm</icon>
> >                 <hideinlevel>novice</hideinlevel>
> >         </DirectoryInfo>
> > ... (and so on)
> > </DirectoryInfoList>
> >
> > For performance purposes, it is bad to
> >         1) read the small /etc/.directoryinfo
> >         2) parse XML
> >         3) read the big /usr/share/directoryinfos/$LANG/directoryinfo.xml
> >         4) parse the big XML
> >         5) execute the logic of the directory description
> > every time the user accesses the directory,
> > this information should be either cached in memory or have their default
> > values for the chosen $LANG put directly to the .directoryinfo file using
> > some automated method.
>






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