@@TITLE Directory Structure@@

Your MUDLib's Directory Structure

Where do I put all this stuff?

You've probably asked yourself that several times already, just getting started. When you make a new library, or a new clonable, or a new data file, where do you put it? This document can get you started.

Where you put stuff is surprisingly important. The Kernel MUDLib hardcodes a lot of behavior according to the path to a given file. That includes a lot of information about who has access to what, and whether an object is inheritable, clonable or an LWO. So let's hit some basic guidelines.

Where do specific object types go?

You'll need to put a "/lib/" directory somewhere in the path to every library (inheritable). The Kernel MUDLib requires it. It's good practice. It's good documentation. Do it. You'll also need to not put "/obj/" or "/data/" anywhere in that path. For more information about those paths, and whether an object is cloneable or inheritable, see the page about Inheritance in the Kernel Library. It'll explain what's mandatory.

Daemons are objects like any others, but they're meant to be used by doing a find_object on them and calling their methods with call_other. Daemons often wind up in a directory with "/sys/" in the name instead of "/lib/", "/data/" or "/obj/". This is purely optional, mostly a form of documentation. You're just saying that you plan to use objects in that directory as daemons. It's still a good idea.

What about Data?

This one's important too, but for different reasons. You don't need to have a particular piece of your path to open a file with read_file(). But different paths require different permissions to access. For instance, stuff in "/usr/System" is readable and writable only by the privileged admin user (by default) and by anybody you explicitly grant access to. In general, permissions are given per-directory You'll want to set aside a place somewhere under /usr/ to put any piece of data, because generally only code in that same user's directory can read it (or everybody can, if you put it in "/usr/Foo/open/").

Files with passwords in them are a good example. While passwords are encrypted, they're not unbreakable, so often you want to avoid giving people read access. That keeps them from using a password cracking program, or at least makes it harder. You may need to give certain wizards read access to the System directory but not want them to be able to read all the save files. By putting the save files somewhere else (say under /usr/Secret or something), you can prevent anybody that doesn't have full admin permission from being able to read or write the user data files. Note that you'll have to write your password code carefully so that it can still read it!

What directories does the Kernel Library treat specially?

The Kernel Library checks various things about the path in many of its operations. Let's look at different operations, and what the Kernel Library checks about the path for each one.


Specific Projects

This is part of the Adding Stuff section, so what kind of stuff should you add? One simple answer is "everything", since this document tells you where everything goes. But there are also some projects you can undertake to improve your MUDLib.

For instance, a simple thing you can do is to move your user data from its current save location to another, as we suggest above. Mainly you'll need to modify "user.c". Go give it a try!


@@INCLUDE directory_structure/1@@

@@INCLUDE directory_structure/2@@

@@INCLUDE directory_structure/3@@

@@INCLUDE directory_structure/4@@

@@INCLUDE directory_structure/5@@

@@INCLUDE directory_structure/6@@

@@INCLUDE melville_klib_1@@

@@INCLUDE melville_klib_2@@

@@INCLUDE melville_klib_3@@