Add "file_delete" method in String and NativeString.
[nit.git] / lib / standard / file_nit.c
index cf14118..50465f3 100644 (file)
@@ -2,6 +2,7 @@
  *
  * Copyright 2004-2008 Jean Privat <jean@pryen.org>
  * Copyright 2008 Floréal Morandat <morandat@lirmm.fr> 
+ * Copyright 2008 Jean-Sébastien Gélinas <calestar@gmail.com>
  *
  * This file is free software, which comes along with NIT.  This software is
  * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
@@ -47,3 +48,7 @@ int file_NativeFile_NativeFile_file_stat_0(FILE *f){
                return to_nit_file_stat(&buff);
        return 0;
 }
+
+extern int string_NativeString_NativeString_file_delete_0(char *f){
+  return (remove(f) == 0);
+}