seed r176 - trunk/extensions
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r176 - trunk/extensions
- Date: Sat, 8 Nov 2008 00:36:08 +0000 (UTC)
Author: racarr
Date: Sat Nov 8 00:36:08 2008
New Revision: 176
URL: http://svn.gnome.org/viewvc/seed?rev=176&view=rev
Log:
Make Gio.simple_read and Gio.simple_write verify that files are regular
files or symlinks.
Modified:
trunk/extensions/Gio.js
Modified: trunk/extensions/Gio.js
==============================================================================
--- trunk/extensions/Gio.js (original)
+++ trunk/extensions/Gio.js Sat Nov 8 00:36:08 2008
@@ -12,6 +12,11 @@
Gio.simple_write = function(file, name)
{
var file = Gio.file_new_for_path(file);
+ var info = file.query_info("standard::type");
+ var type = info.get_file_type();
+ if ((type != Gio.FileType.regular)
+ && (type != Gio.FileType.symbolic_link))
+ return;
var fstream = file.replace();
var dstream = Gio.DataOutputStream._new(fstream);
@@ -22,6 +27,11 @@
Gio.simple_read = function(name)
{
var file = Gio.file_new_for_path(name);
+ var info = file.query_info("standard::type");
+ var type = info.get_file_type();
+ if ((type != Gio.FileType.regular)
+ && (type != Gio.FileType.symbolic_link))
+ return null;
var fstream = file.read();
var dstream = Gio.DataInputStream._new(fstream);
var line = dstream.read_until("", 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]