tail.c

merentha_fluffos_v2/lib/cmds/admin/tail.c · 478 B

From the archive merentha_fluffos_v2.zip

Download the archive   « Back to the archive contents

// Petrarch
// Merentha Lib 1.0
// <tail>

varargs int command(string fname) {
     string str;
     int i;

     if(!fname) return notify_fail("Syntax: tail <file>\n");
     if(fname[0..0]!="/") fname=this_player()->query_cwd()+fname;
     if (sizeof(fname) < 0) return notify_fail("File does not exist.\n");
     
     if(!i=this_player()->getenv("LINES")) i=20;
     message("command", implode(explode(read_file(fname), "\n")[<i..<1],"\n"), this_player());

     return 1;
}

Site Stats

Snippets: 1791
Codebases: 571