<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://toorcon.techpathways.com/cs/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ProScript and Perl </title><link>http://toorcon.techpathways.com/cs/forums/5/ShowForum.aspx</link><description>Discussions related to the ProScript API and Perl</description><dc:language>en-US</dc:language><generator>CommunityServer 2.0 (Build: 60217.2664)</generator><item><title>PSRead() Example</title><link>http://toorcon.techpathways.com/cs/forums/thread/67.aspx</link><pubDate>Mon, 18 Sep 2006 18:53:37 GMT</pubDate><guid isPermaLink="false">e7e58421-8683-42c1-b30c-f6943a49c522:67</guid><dc:creator>Chris</dc:creator><slash:comments>0</slash:comments><comments>http://toorcon.techpathways.com/cs/forums/thread/67.aspx</comments><wfw:commentRss>http://toorcon.techpathways.com/cs/forums/commentrss.aspx?SectionID=5&amp;PostID=67</wfw:commentRss><description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;FONT size=2&gt;
&lt;P&gt;The example given for PSRead() in the ProScript documentation lacks a useful program. Here is a script that will read each line of a file one-by-one until the EOF is reached. I tested on the boot.ini of a local disk. Just add the disk or image to a project, highlight the file in ProDiscovers content view, then right-click and choose run ProScript. The parameters will be auto-filled, then choose the script and run. &lt;/P&gt;
&lt;P&gt;---------PSRead() Example----------------&lt;/P&gt;
&lt;P&gt;use ProScript;&lt;/P&gt;
&lt;P&gt;$TotalArg = @ARGV;&lt;/P&gt;
&lt;P&gt;if ($TotalArg != 1)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PSDisplayText("Usage: script_name &amp;lt;FILE_NAME&amp;gt;");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exit;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$handle = PSOpen($ARGV[0]);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ($handle == 0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PSDisplayText ("Unable to find $ARGV[0]");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;while(!PSIsEOF($handle))&lt;/P&gt;
&lt;P&gt;{ &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$buffer = &amp;amp;ProScript::PSRead($handle);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PSDisplayText("Contents: $buffer");&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;PSClose($handle);&lt;/P&gt;
&lt;P&gt;------------- End Example -------------------&lt;/P&gt;&lt;/FONT&gt;</description></item></channel></rss>