seed r59 - trunk/extensions



Author: racarr
Date: Sun Nov  2 10:26:11 2008
New Revision: 59
URL: http://svn.gnome.org/viewvc/seed?rev=59&view=rev

Log:
Add Gio.simple_write. 


Modified:
   trunk/extensions/Gio.js

Modified: trunk/extensions/Gio.js
==============================================================================
--- trunk/extensions/Gio.js	(original)
+++ trunk/extensions/Gio.js	Sun Nov  2 10:26:11 2008
@@ -2,7 +2,17 @@
 
 prototype.get_contents = function()
 {
-	stream = Gio.DataInputStream._new(this);
-	line = stream.read_until("", 0);
+	var stream = Gio.DataInputStream._new(this);
+	var line = stream.read_until("", 0);
 	return line;	
 }
+
+Gio.simple_write = function(file, name)
+{
+	var file = Gio.file_new_for_path(file);
+	var fstream = file.replace();
+	var dstream = Gio.DataOutputStream._new(fstream);
+	
+	dstream.put_string(name);
+	fstream.close();
+}
\ No newline at end of file



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