mkdir.c

final_realms_fluffos_v1/lib/cmds/creator.old/mkdir.c · 541 B

From the archive final_realms_fluffos_v1.zip

Download the archive   « Back to the archive contents

#include <standard.h>
#include <cmd.h>
inherit CMD_BASE;

void setup(){

position = 1;
}



static int cmd(string str, object me) {

   if (!str || str == "") {
      notify_fail("Make what directory?\n");
      return 0;
      }
   str = this_player()->get_path(str);

   if (!str)
      return 1;

   if (file_size(str) != -1) {
      notify_fail(str + " already exists.\n");
      return 0;
      }
    if (!mkdir(str)) {
      notify_fail("Couldn't make dir.\n");
      return 0;
   }
   write("Ok.\n");
   return 1;
} /* makedir() */
 

Site Stats

Snippets: 1791
Codebases: 571