<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FoxLing - 前端开发 &#187; 保存文本</title>
	<atom:link href="http://foxling.org/tag/%e4%bf%9d%e5%ad%98%e6%96%87%e6%9c%ac/feed/" rel="self" type="application/rss+xml" />
	<link>http://foxling.org</link>
	<description>不积跬步 无以至千里</description>
	<lastBuildDate>Sat, 19 Nov 2011 16:29:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>FireFox扩展开发，保存文本文件。</title>
		<link>http://foxling.org/firefox/firefox-extensions-save-text-file/</link>
		<comments>http://foxling.org/firefox/firefox-extensions-save-text-file/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 19:24:06 +0000</pubDate>
		<dc:creator>FoxLing</dc:creator>
				<category><![CDATA[FireFox]]></category>
		<category><![CDATA[FireFox扩展]]></category>
		<category><![CDATA[保存文本]]></category>

		<guid isPermaLink="false">http://wp.foxling.cn/as-flex-air/52/</guid>
		<description><![CDATA[var file = Components.classes[&#34;@mozilla.org/file/directory_service;1&#34;] .getService(Components.interfaces.nsIProperties) .get(&#34;AChrom&#34;, Components.interfaces.nsIFile); //.get(&#34;DeskP&#34;, Components.interfaces.nsIFile); file.append(&#34;t.txt&#34;); var strm = Components.classes[&#34;@mozilla.org/network/file-output-stream;1&#34;].cr&#101;ateInstance(Components.interfaces.nsIFileOutputStream); strm.QueryInterface(Components.interfaces.nsIOutputStream); strm.QueryInterface(Components.interfaces.nsISeekableStream); strm.init( file, 0x04 &#124; 0x08 &#124; 0x10, 420, 0 ); strm.write(str,str.length ); strm.flush(); strm.close(); function read(readfile) { var file = Components.classes[&#34;@mozilla.org/file/local;1&#34;] .cr&#101;ateInstance(Components.interfaces.nsILocalFile); file.initWithPath(readfile); var is = Components.classes[&#34;@mozilla.org/network/file-input-stream;1&#34;] .cr&#101;ateInstance(Components.interfaces.nsIFileInputStream); is.init(file, 0x01, 00004, null); var sis = Components.classes[&#34;@mozilla.org/scriptableinputstream;1&#34;] .cr&#101;ateInstance(Components.interfaces.nsIScriptableInputStream); sis.init(is); var [...]]]></description>
			<content:encoded><![CDATA[<pre>
var file = Components.classes[&#34;@mozilla.org/file/directory_service;1&#34;]
.getService(Components.interfaces.nsIProperties)
.get(&#34;AChrom&#34;, Components.interfaces.nsIFile);
//.get(&#34;DeskP&#34;, Components.interfaces.nsIFile);
file.append(&#34;t.txt&#34;);

var strm = Components.classes[&#34;@mozilla.org/network/file-output-stream;1&#34;].cr&#101;ateInstance(Components.interfaces.nsIFileOutputStream);
strm.QueryInterface(Components.interfaces.nsIOutputStream);
strm.QueryInterface(Components.interfaces.nsISeekableStream);
strm.init( file, 0x04 | 0x08 | 0x10, 420, 0 );
strm.write(str,str.length );
strm.flush();
strm.close();
</pre>
<pre>
function read(readfile)
{
var file = Components.classes[&#34;@mozilla.org/file/local;1&#34;]
.cr&#101;ateInstance(Components.interfaces.nsILocalFile);
file.initWithPath(readfile);
var is =
Components.classes[&#34;@mozilla.org/network/file-input-stream;1&#34;]
.cr&#101;ateInstance(Components.interfaces.nsIFileInputStream);
is.init(file, 0x01, 00004, null);
var sis =
Components.classes[&#34;@mozilla.org/scriptableinputstream;1&#34;]
.cr&#101;ateInstance(Components.interfaces.nsIScriptableInputStream);
sis.init(is);
var output = sis.read(sis.available());
alert(output);
}
read(&#34;C:\test.txt&#34;);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://foxling.org/firefox/firefox-extensions-save-text-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

