# file location

**URL:** <https://community.gatling.io/t/file-location/5957>\
**Category:** Gatling (Open-Source)\
**Created:** [January 14, 2021, 12:36am UTC](https://community.gatling.io/t/file-location/5957 "2021-01-14T00:36:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sn02](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@sn02](https://community.gatling.io/u/sn02)\
**Post date:** [January 14, 2021, 12:36am UTC](https://community.gatling.io/t/file-location/5957/1 "2021-01-14T00:36:21Z")

</div>

I created a file under main/resources/xyz.txt and when I get the file and print it like this -

val commitFile: String = getClass.getResource("/xyz.txt").getFile

I see that its actually under target/scala-2.12/classes/xyz.txt

why is that? Is there a way I can change this?

Also is there a way I can write to this file or is it read only?

Please help

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [January 14, 2021, 9:25am UTC](https://community.gatling.io/t/file-location/5957/2 "2021-01-14T09:25:51Z")

</div>

Hello,

It is not a Gatling specificity. It has to do with how the JVM loads resources.

In real runtime environment, it is inside a jar (a zip formatted file for the JVM).

This specific file will be read-only.

However, you can copy it where you want (ie a temporary file for example) and modify the copy and use that copy afterward.  
But, again, keep in mind that is not a gatling specificity and you should look for resources usage in the JVM (either java or scala)

Cheers!
