1

I am trying to check if abcd.png exists inside the flows folder

flows/abcd.png

so in groovy I am doing this

def file = new File("flows/abcd.png").exists()

but it is returning false. When I do ls I can see the file exists inside the flows folder as well. What am I doing wrong? Any help would be appreciated

Also I tried with

"/flows/abcd.png"
".flows/abcd.png"
"./flows/abcd.png"

But it gives false for all the cases

Cyrus
  • 77,979
  • 13
  • 71
  • 125
Saurav Dutta
  • 57
  • 2
  • 6
  • 5
    Debug/print your current working directory inside your groovy script (https://stackoverflow.com/questions/4871051/how-to-get-the-current-working-directory-in-java); your code there is correct - most likely you are not running it from where you think you are running it. – cfrick May 22 '20 at 09:55

0 Answers0