ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

UNIXCMD as ls oddities

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • UNIXCMD as ls oddities

    Code:
    lStdIn = 'cd "/QNTC/shareName/folder Name/";'
    + 'ls *000-ABCDEFGHI*01-26-2018*' ;
    Open UNIX;
    Read UNIX lStdOut;
    Dow not %eof(UNIX);
      Read UNIX lStdOut;
    Enddo;
    Close UNIX; // this line throws an error
    This code returns for lStdOut:
    ls: 001-2113 Error found getting information for object Ø. No such path or directory.
    000-ABCDEFGHI-0001-ABCDE-(01-26-2018-14_19_46_3364362).txt
    000-ABCDEFGHI-0001-ABCDE-(01-26-2018-14_19_46_3364362).txt

    Errors:
    RNX1217 Error message appeared during CLOSE.
    CPF9897 Child process ended with status 1.


    Running the same command using QSH CMD() works fine.

    How do I go about troubleshooting this?

  • #2
    The name lStdIn is a bit of a misnomer in this case, because you don't seem to be using it for the stdin (standard input) stream, but instead, for the command. So that's confusing, but not related to the problem.

    For some reason, ls seems to think you're passing a Ø character as a parameter to it. I don't see anything you're doing that would cause that, though. I could try some parts of your code, but I don't have a PC that I can access via QNTC, so I can't do exactly what you're doing.

    Do you get this on other directories or other path names? If I had something I could actually run that would cause the same problem, it sure would make it a lot easier for me to troubleshoot.

    Comment


    • #3
      I see this anomaly consistently within my real *SRVPGM, but I've been unable to recreate it in a stripped-down *SRVPGM.
      • The QNTC file system doesn't seem to be the problem. I recreated the directory structure under /tmp/, and I see the same thing.
      • I changed the ls to, 'ls *ABCDEFGHI*' but there was no change.
      • I tried removing the embedded blank in the dir name, but that didn't help either.

      Comment


      • #4
        So this happens in a srvpgm that you wrote, but when you created a stripped down version of the srvpgm, it does not? Makes me think that there's a problem in the "real" srvpgm, like it is screwing up memory or something like that.

        Comment


        • #5
          Originally posted by Scott Klement View Post
          So this happens in a srvpgm that you wrote, but when you created a stripped down version of the srvpgm, it does not? Makes me think that there's a problem in the "real" srvpgm, like it is screwing up memory or something like that.
          Perfectly reasonable assessment. I don't see what it could be though. The UNIXCMD code is a contiguous block, with no other code in between.

          Comment

          Working...
          X