Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68653

findFiles cuts off first character of path when run at drive root

XMLWordPrintable

      Here's an unusual issue I ran into while running findFiles at a drive root. Demonstration script (runs on Windows):

      def script = this
      script.node(label: 'overwatch') {
          script.writeFile file: "sample/bar.txt", text: "bar"
          script.writeFile file: "sample/baz.txt", text: "baz"
          script.bat "subst U: sample"
          try {
              script.dir("U:/") {
                  def files = script.findFiles glob: "b*.txt"
                  script.echo "${files}"
              }
          } finally {
              // undo the subst
              script.bat "subst U: /d"
          }
      } 

      File search seems to work as normal, just the returned paths have their first character missing: instead of "[bar.txt, baz.txt]", it returns "[ar.txt, az.txt]". This occurs with folders too: "sample/foo.txt" becomes "ample/foo.txt". 

       

            rsandell rsandell
            pwong_phxlabs Phillip Wong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: