Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Filesys::SmbClientParser Get Files Randomly Fails with no Error

by Corion (Patriarch)
on Nov 21, 2016 at 20:20 UTC ( [id://1176281]=note: print w/replies, xml ) Need Help??


in reply to Filesys::SmbClientParser Get Files Randomly Fails with no Error

Have you tried reducing your code to the relevant 10 lines or so? Without seeing and knowing your complete program, it is hard for us to advise you in a good way because we can't tell what is old code, which code is actually run and what values the various variables have.

Ideally, you can produce a short, self-contained script that uses the relevant module(s) and runs a short loop that at a certain time fails so we can easily reproduce the problem. Note that we will also need the output of that program and an exact description of what you think it does and why that is not what you want, and what exactly you want.

While trying to read through your code as shown above, I noticed that it tries to call smb->get ("$file") twice. This seems weird. Maybe the lack of error checking on the first (or second) call is relevant?

Also note that I'm quite unclear on what you mean by 'This code consistently spits out a "1"' - I don't see any print statement, or return statement, or anything else that would spit out a number. Maybe this is hidden somewhere in the logfile that you haven't shown us.

One thing that might be problematic for you might be filesystem encodings between the remote/SMB filesystem and your local filesystem, and the mechanism by which the module parses the output. Usually, unixishes OSes blindly assume that all filenames are UTF-8 encoded octets. SMB filesystems might have a different encoding for the filenames, but will still return the raw octets to the caller.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-19 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found