<?xml version="1.0" encoding="windows-1252"?>
<node id="602546" title="Re: Deleting on Files" created="2007-02-28 11:48:24" updated="2007-02-28 06:48:24">
<type id="11">
note</type>
<author id="33341">
Albannach</author>
<data>
<field name="doctext">
While [philcrow] undoubtedly has the [id://602531|right approach] to this problem, I'm surprised nobody has mentioned Perl's own [perldoc://truncate] function, which works just fine in Win32 and is neater than the [perldoc://open] solutions.
&lt;p&gt;
&lt;b&gt;Update:&lt;/b&gt;  there is no need to [perldoc://open] the file, as truncate will operate on the file &lt;i&gt;name&lt;/i&gt;, e.g. &lt;code&gt;truncate 'myfile.log', 0;&lt;/code&gt; will set the length of the file to zero, but you can use any desired length in that place.
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-33341"&gt;
&lt;p&gt;--&lt;br&gt;
I'd like to be able to assign to an luser
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
602529</field>
<field name="parent_node">
602529</field>
</data>
</node>
