A
Alian
Hello,
I work on a module that allow access to windows share from unix world with help
of samba API. This module allow things like:
use Filesys::Smbclient;
my $smb = new Filesys::SmbClient;
my $fd = $smb->open("<smb://jupiter/doc/general.css")
or die "Can't open it:$!\n";
while (my $l= $smb->read($fd,50)) {print $l; }
$smb->close(fd);
but too with the help of the magic tie command:
use Filesys::Smbclient;
use File::Copy;
local *FD;
tie(*FD, 'Filesys::SmbClient',">smb://jupiter/toto/tata", 0755);
copy(\*FD, "/tmp/toto");
But this last one complain with:
stat() on closed filehandle FD at /usr/local/perl-5.8.5/lib/5.8.5/File/Copy.pm
line 82, <F> line 1.
(The copy command work well even I’ve been getting an error code from copy method.)
In perldoc perltie, I can read in BUG section:
Tied filehandles are still incomplete. sysopen(), truncate(), flock(), fcntl(),
stat() and -X can’t currently be trapped.
Is this a "todo" or a "can't" ? Can someone give some reasons about this
restriction and where I must read code to understand this warning ?
Thanks,
I work on a module that allow access to windows share from unix world with help
of samba API. This module allow things like:
use Filesys::Smbclient;
my $smb = new Filesys::SmbClient;
my $fd = $smb->open("<smb://jupiter/doc/general.css")
or die "Can't open it:$!\n";
while (my $l= $smb->read($fd,50)) {print $l; }
$smb->close(fd);
but too with the help of the magic tie command:
use Filesys::Smbclient;
use File::Copy;
local *FD;
tie(*FD, 'Filesys::SmbClient',">smb://jupiter/toto/tata", 0755);
copy(\*FD, "/tmp/toto");
But this last one complain with:
stat() on closed filehandle FD at /usr/local/perl-5.8.5/lib/5.8.5/File/Copy.pm
line 82, <F> line 1.
(The copy command work well even I’ve been getting an error code from copy method.)
In perldoc perltie, I can read in BUG section:
Tied filehandles are still incomplete. sysopen(), truncate(), flock(), fcntl(),
stat() and -X can’t currently be trapped.
Is this a "todo" or a "can't" ? Can someone give some reasons about this
restriction and where I must read code to understand this warning ?
Thanks,