Home  |  Linux  | Mysql  | PHP  | XML
From:Chris Nandor Date:Fri Mar 21 16:11:49 2003
Subject:Re: [MacPerl-Toolbox] strip the resource fork
http://archive.develooper.com/macperl@perl.org/msg02178.html

>Here's another way, if you really want to destroy it and avoid copying:
>
>	use Fcntl ();
>	use POSIX ();
>
>	my $resfork = POSIX::open($file,
>		&POSIX::O_WRONLY | &POSIX::O_TRUNC | &Fcntl::O_RSRC
>	);
>	POSIX::close($resfork);
>
>This will truncate the resource fork to size 0, which essentially deletes it.

Without testing, I am fairly certain the fork will be gone.  You can test
by attempting to open the file in ResEdit to see if it asks if you want to
create a new resource fork for the file.

-- 
Chris Nandor                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/
Navigate in group perl.macperl.toolbox at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants