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.


In reply to Re: Filesys::SmbClientParser Get Files Randomly Fails with no Error by Corion
in thread Filesys::SmbClientParser Get Files Randomly Fails with no Error by csftpteam

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.