[Commit] nickle/builtin file.c,1.11,1.12

Keith Packard commit at keithp.com
Thu Jun 26 02:59:12 PDT 2003


Committed by: keithp

Update of /local/src/CVS/nickle/builtin
In directory home.keithp.com:/tmp/cvs-serv4289/builtin

Modified Files:
	file.c 
Log Message:
Add File::reopen

Index: file.c
===================================================================
RCS file: /local/src/CVS/nickle/builtin/file.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- file.c	29 May 2003 18:36:35 -0000	1.11
+++ file.c	26 Jun 2003 08:59:10 -0000	1.12
@@ -61,6 +61,7 @@
 
     static const struct fbuiltin_3 funcs_3[] = {
         { do_File_pipe, "pipe", "f", "sA*ss" },
+	{ do_File_reopen, "reopen", "f", "ssf" },
         { 0 }
     };
 
@@ -223,6 +224,30 @@
 				FileGetErrorMessage (err),
 				2, FileGetError (err), file);
 	ret = Void;
+    }
+    complete = True;
+    RETURN (ret);
+}
+
+Value
+do_File_reopen (Value name, Value mode, Value file)
+{
+    ENTER ();
+    char	*n, *m;
+    Value	ret;
+    int		err;
+
+    n = StringChars (&name->string);
+    m = StringChars (&mode->string);
+    if (aborting)
+	RETURN (Void);
+    ret = FileReopen (n, m, file, &err);
+    if (!ret)
+    {
+	RaiseStandardException (exception_open_error,
+				FileGetErrorMessage (err),
+				2, FileGetError (err), name);
+	RETURN (Void);
     }
     complete = True;
     RETURN (ret);




More information about the Commit mailing list