# Task is always up-to-date even when task.outputs.files changed on disk

**URL:** <https://discuss.gradle.org/t/task-is-always-up-to-date-even-when-task-outputs-files-changed-on-disk/23853>\
**Category:** Help/Discuss\
**Created:** [August 23, 2017, 7:31pm UTC](https://discuss.gradle.org/t/task-is-always-up-to-date-even-when-task-outputs-files-changed-on-disk/23853 "2017-08-23T19:31:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hguerard](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hguerard](https://discuss.gradle.org/u/hguerard)\
**Post date:** [August 23, 2017, 7:31pm UTC](https://discuss.gradle.org/t/task-is-always-up-to-date-even-when-task-outputs-files-changed-on-disk/23853/1 "2017-08-23T19:31:50Z")

</div>

Given the following task:

```gradle
task test_outputs() {
	inputs.files file("C:/TEMP/in.txt")
	outputs.files file("C:/TEMP/out.txt")
	doLast {
		println "executing..."
	}
}

```

When I first execute the task, I get the expected output:

```gradle
:test_outputs
executing...

```

If I modify or delete the output file `C:/TEMP/out.txt` file and re-execute the task, I constantly get an up-to-date message:

```gradle
:test_outputs UP-TO-DATE

```

What am I doing wrong ?

By the way, I am using Gradle 4.1 on Windows 10 64-bit

---

<div class="post-metadata">

**Author:** ![sterling](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/sterling/32/5395_2.png) [@sterling](https://discuss.gradle.org/u/sterling)\
**Post date:** [August 23, 2017, 8:56pm UTC](https://discuss.gradle.org/t/task-is-always-up-to-date-even-when-task-outputs-files-changed-on-disk/23853/2 "2017-08-23T20:56:14Z")

</div>

If that’s all the task does (prints a message), Gradle sees that you’re not modifying the output file and assumes there’s a problem with overlapping outputs (or pre-existing files) in the task’s outputs. This is counter-intuitive and there are some changes in the next Gradle release to make this less likely to happen.

If your task did something to `out.txt`, you wouldn’t see this behavior.
