Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Short Read with Filesys::SmbClientParser

by xorl (Deacon)
on Feb 18, 2009 at 19:52 UTC ( [id://744866]=perlquestion: print w/replies, xml ) Need Help??

xorl has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to copy a file from a windows box to a linux box. This will be done weekly so I'm using Perl and the module Filesys::SmbClientParser Here's the relevant code:
my $smb = new Filesys::SmbClientParser (undef, ("user" => $winuser, "password" => $winpassword, "Debug" => "1" ) ); $smb->Host($winserver); $smb->Share($winshare); $smb->get($winlogname, "/tmp/win.log") or die("THERE WAS AN ERROR SMBE +RR: " . $smb->err); print "Winlog now at /tmp/win.log\n";
My problem is that it will give me the following error message:
"Short read when getting file \filename. Only got 671956992 bytes."
Sometimes it will get 0 bytes.

Now thinking this might be some weird issue with smbclient, I did the following from the command line:

[root@mybox scripts]# smbclient -U ftpusr \\\\wit211\\W3SVC1 mypass Domain=[NTDP] OS=[Windows Server 2003 3790 Service Pack 2] Server=[Win +dows Server 2003 5.2] smb: \> get filename getting file \filename of size 1763006291 as filename (8802.2 kb/s) (a +verage 8802.2 kb/s) smb: \> [root@mybox scripts]#
So this makes me think I'm running into some limit or something imposed by Perl or the module.

Does anyone have any suggestions how I can fix this problem?

Thanks in advance

Replies are listed 'Best First'.
Re: Short Read with Filesys::SmbClientParser
by ELISHEVA (Prior) on Feb 19, 2009 at 03:51 UTC

    This kind of problem exists even when one is doing a pure XP/Vista to XP/Vista file transfer. There are frequent complaints about large (500M+) file transfer failures. Some people have had success with disabling their anti-virus software or by reconfiguring their network routers. Others have merely had to unlock a file (permissions will get you every time). I also seem to recall that (on my system) there are some time-out problems as well - though to be honest I didn't investigate the underlying cause too deeply. This is probably not what you want to hear. See:

    I'm sure someone has figured out how to do this reliably because many corporations support automated installs of very large software packages from central servers. However, the last time I had to do this I ended up loading stuff onto a data wand and walking the files from box to box after hours of frustration. Another time, I think I put SSH (client and server) on both boxes and transferred the files that way.

    Best, beth

      Nope not really what I wanted to hear, but thanks anyway.

      I think I found a solution (at least it seems to work). I mount the shared directory that the file is in. I'm not sure why, but I don't end up with the problem when I do that.

      If it turns out I'm just getting lucky, I think I'll end up doing your last solution which is to put an SSH (client and server) on both boxes and transfer them that way.

Re: Short Read with Filesys::SmbClientParser
by Anonymous Monk on Feb 18, 2009 at 22:05 UTC
    It seems to be a common problem, related to the buffersize.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://744866]
Approved by eff_i_g
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-19 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found