# \`touch\` function errors where touch command in terminal works

**URL:** <https://discourse.julialang.org/t/touch-function-errors-where-touch-command-in-terminal-works/116510>\
**Category:** General Usage\
**Tags:** filesystem\
**Created:** [July 2, 2024, 9:54am UTC](https://discourse.julialang.org/t/touch-function-errors-where-touch-command-in-terminal-works/116510 "2024-07-02T09:54:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [July 2, 2024, 9:54am UTC](https://discourse.julialang.org/t/touch-function-errors-where-touch-command-in-terminal-works/116510/1 "2024-07-02T09:54:59Z")

</div>

I am unable to update the modification time of a folder using `touch`:

```julia
julia> mkdir("temp")
"temp"

julia> mtime("temp")
1.7199137885920577e9

julia> touch("temp")
ERROR: IOError: open("temp", 65, 438): illegal operation on a directory (EISDIR)
Stacktrace:
 [1] uv_error
   @ ./libuv.jl:100 [inlined]
 [2] open(path::String, flags::UInt16, mode::UInt16)
   @ Base.Filesystem ./filesystem.jl:121
 [3] touch(path::String)
   @ Base.Filesystem ./file.jl:458
 [4] top-level scope
   @ REPL[3]:1

```

This is consistent with the docstring. But running the `touch` system tool does the trick:

```julia
julia> run(`touch "temp"`)
Process(`touch temp`, ProcessExited(0))

julia> mtime("temp")
1.7199138136918852e9

```

The fact that this command works on directories calls the error message “illegal operation on a directory” into question. Should the function not work more or less the same as the system tool?

I am running Julia 1.10 on Linux Debian in case it is relevant.
