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

This issue is archived. You can view it, but you can't modify it. Learn more

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". 

       

            Assignee:
            rsandell
            Reporter:
            Phillip Wong
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: