title: Unable to Create New file in Jenkins Pipeline
body: <p>I am trying to create New file in Jenkins Pipeline , by getting error. 
  error:
  java.io.FileNotFoundException: /var/lib/jenkins/workspace/Pipeline-Groovy/test.txt (No such file or directory)</p>
  
  <p>But when i am executing below commands without pipeline , It's created new file</p>
  
  <pre><code>def newFile = new File("/var/lib/jenkins/workspace/test/test.txt")
  newFile.append("hello\n")
  println newFile.text
  </code></pre>
  
  <p>If i use same code in Pipeline getting above error</p>
  
  <pre><code>pipeline {
  
      agent any
  
  
      options {
          buildDiscarder(logRotator(numToKeepStr: '5'))
  
          timestamps()
      }
      stages {
          stage('Demo1-stage') {
              steps {
                  deleteDir()
                      script {
  
                          def Jobname = "${JOB_NAME}"
                          echo Jobname
                      }
              }
          }
          stage('Demo-2stage') {
              steps {
                  script {
  
                      def workspace = "${WORKSPACE}"
                      echo workspace
                      def newFile = new File("/var/lib/jenkins/workspace/Pipeline-Groovy/test.txt")
                      newFile.createNewFile() 
                      sh 'ls -lrt'
                      }
                  }
              }
          }
      }
  </code></pre>