[Gridflow-cvs] [svn] commit: r5121 - /trunk/src/classes2.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Mon Mar 15 19:33:48 EDT 2010


Author: matju
Date: Mon Mar 15 19:33:47 2010
New Revision: 5121

Log:
add [gf/getcwd] wrapping getcwd() posix kernel function

Modified:
    trunk/src/classes2.cxx

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Mon Mar 15 19:33:47 2010
@@ -1385,6 +1385,17 @@
 	}
 };
 \end class {install("gf/getpid",1,2);}
+\class GFGetCwd : FObject {
+	static t_symbol *sym;
+	\constructor () {}
+	\decl 0 bang () {
+	    char bof[PATH_MAX];
+	    if (!getcwd(bof,sizeof(bof))) RAISE("getcwd: %s",strerror(errno));
+	    outlet_symbol(outlets[0],gensym(bof));
+	}
+};
+\end class {install("gf/getcwd",1,1);}
+
 \class GFSelector : FObject {
 	\constructor () {}
 	\decl void anything (...) {outlet_symbol(outlets[0],gensym(argv[0].a_symbol->s_name+3));}



More information about the Gridflow-cvs mailing list