seed r64 - trunk/extensions



Author: racarr
Date: Sun Nov  2 23:12:42 2008
New Revision: 64
URL: http://svn.gnome.org/viewvc/seed?rev=64&view=rev

Log:
Add Gio.simple_read


Modified:
   trunk/extensions/Gio.js

Modified: trunk/extensions/Gio.js
==============================================================================
--- trunk/extensions/Gio.js	(original)
+++ trunk/extensions/Gio.js	Sun Nov  2 23:12:42 2008
@@ -15,4 +15,14 @@
 	
 	dstream.put_string(name);
 	fstream.close();
-}
\ No newline at end of file
+}
+
+Gio.simple_read = function(name)
+{
+	var file = Gio.file_new_for_path(name);
+	var fstream = file.read();
+	var dstream = Gio.DataInputStream._new(fstream);
+	var line = dstream.read_until("", 0);
+	fstream.close();
+	return line;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]