mud/lib/cmds/creators/file.c
2020-09-06 05:43:07 -07:00

34 lines
714 B
C

#include <lib.h>
inherit LIB_DAEMON;
int cmd(string str) {
object ob;
string basename, filename;
if(!str || str == "here") {
ob = environment(this_player());
}
else ob = get_object(str, this_player());
if(!ob) {
write("That object can't be found.");
return 1;
}
filename = file_name(ob);
basename = base_name(ob);
write("The unique object identifier is: "+filename);
write("The file it is loaded from is: "+basename+".c");
return 1;
}
string GetHelp() {
return "Syntax: file [thing]\n\n"+
"Provides information about the thing's name and file of origin.\n"+
"With no argument, it defaults to your location.\n";
}