From: Haddixx Subject: [Circle] [CODE] File Viewer The recent post of code snippets that had a function to view the last 20 lines of the syslog really inspired me. I created a function that allows people to view various log files. Gods can request how many lines they want look at, etc. IMHO I think it makes a good code snippet. ACMD(do_file) { FILE *req_file; int cur_line = 0, num_lines = 0, req_lines = 0, i, j; int l; char field[MAX_INPUT_LENGTH], value[MAX_INPUT_LENGTH]; struct file_struct { char *cmd; char level; char *file; } fields[] = { { "none", LVL_IMPL, "Does Nothing" }, { "bug", LVL_IMPL, "../lib/misc/bugs"}, { "typo", LVL_BUILDER, "../lib/misc/typos"}, { "ideas", LVL_IMPL, "../lib/misc/ideas"}, { "xnames", LVL_IMPL, "../lib/misc/xnames"}, { "levels", LVL_MINOR, "../log/levels" }, { "rip", LVL_MINOR, "../log/rip" }, { "players", LVL_MINOR, "../log/newplayers" }, { "rentgone", LVL_MINOR, "../log/rentgone" }, { "godcmds", LVL_IMPL, "../log/godcmds" }, { "syslog", LVL_IMPL, "../syslog" }, { "crash", LVL_IMPL, "../syslog.CRASH" }, { "\n", 0, "\n" } }; skip_spaces(&argument); if (!*argument) { strcpy(buf, "USAGE: file