blob: 6f233d0e60445ed4e6ce842c7126cb3209a3071c [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001 LPC Basics
2 Written by Descartes of Borg
3 first edition: 23 april 1993
4 second edition: 25 may 1993
5
6CHAPTER 1: Introduction to the Coding Environment
7
81.1 UNIX file structure
9LPMuds use basic UNIX commands and its file structure. If you know
10UNIX commands already, then note (with a few exceptions) options are
11not available to the commands. Like DOS, UNIX is heirarchical. The
12root directory of which all directories are sub-directories is called
13root(/). And from those sub-directories you may have further
14sub-directories. A directory may be referred to in two different ways:
151) by its full name, or absolute name, or 2) by its relative name.
16Absolute name refers to the directory's full path starting from / winding
17down the directory tree until you name the directory in question. For
18example:
19
20 /players/descartes/obj/monster
21
22refers to the directory monster which is a sub-directory of obj which
23is a sub-directory of descartes which is a sub-directory of players
24which is a sudirectory of /.
25
26The relative name refers to the name relative to another directory.
27The above example is called monster relative to /players/descartes/obj,
28but it is also called obj/monster relative to /players/descartes,
29descartes/obj/monster relative to /players, and finally
30players/descartes/obj/monster relative to /. You can tell the
31difference between absolute names and relative names because absolute
32names always start with /. In order to know exactly which directory
33is being named by a relative name, you naturally must know what
34directory it is relative to.
35
36A directory contains sub-directories and files. LPMuds only use text files
37inside the mudlib. Like directories, files have both absolute and
38relative names. The most basic relative name is often referred to as the file
39name, with the rest of the absolute name being referred to as the path. So,
40for the file: /players/descartes/castle.c, castle.c is the file name, and
41/players/descartes is the path.
42
43On some muds, a file with a file name beginning with a . (like .plan) is
44not visible when you list files with the regular file listing command.
45
461.2 UNIX Commands
47Along with the UNIX file structure, LPMuds use many UNIX commands. Typical
48UNIX commands on most muds are:
49pwd, cd, ls, rm, mv, cp, mkdir, rmdir, more, head, cat, ed
50If you have never before seen UNIX commands, you probably are thinking this
51is all nonsense. Well, it is, but you got to use them. Before getting
52into what they mean though, first a discussion of current directory.
53If you know DOS, then you know what a current working directory is.
54At any given point, you are considered to be "in" some directory. This
55means that any relative file or directory names you give in UNIX commands
56are relative to that directory. For example, if my current directory is
57/players/descartes and I type "ed castle.c" (ed is the command to edit),
58then it assumes I mean the file /players/descartes/castle.c
59
60pwd: shows you your current working directory
61cd: changes your current working directory. You may give either relative
62 or absolute path names. With no arguments, it changes to your home
63 directory.
64ls: lists all files in the directory named. If no directory is named,
65 it lists the files of the current working directory
66rm: deletes the file named
67mv: renames the file named
68cp: copies the file named
69mkdir: makes a new directory
70rmdir: deletes a directory. All files must have been first removed.
71more: pages the file named so that the file appears on your screen one
72 page at a time.
73cat: shows the whole file to you at once
74head: shows you the first several lines of a file
75tail: shows you the last several lines of a file
76ed: allows you to edit a file using the mud editor
77
781.3 Chapter Summary
79UNIX uses a heirarchical file structure with the root of the tree being
80named /. Other directories branch off from that root directory and
81in turn have their own sub-directories. All directories may contain
82directories and files. Directories and files are referred to either
83by their absolute name, which always begins with /, or by their relative
84name which gives the file's name relative to a particular directory.
85In order to get around in the UNIX files structure, you have the
86typical UNIX commands for listing files, your current directory, etc.
87On your mud, all of the above commands should have detailed help commands
88to help you explore exactly what they do. In addition, there should
89be a very detailed file on your mud's editor. If you are unfamiliar
90with ed, you should go over this convoluted file.