Cannot Create Empty File (Using WSL)
I am using Intellij 2021.1.2, I am on Windows 10, but have been doing my projects through WSL. When I initially run my code I get this error message:
java.io.IOException: Cannot create empty file: /home/rachel_ary/.cache/JetBrains/IntelliJIdea2021.1/compile-server/sfg-di_38c0075e/timestamps/data
Or similar with different pathnames.
I know this is a permissions error that stems from me running IntelliJ in Windows and then doing all my work with a WSL pathname. I have been getting around it by creating the folders manually and/or changing the permissions so Intellij can write to it.
I was wondering though if there is a way to fix this error in IntelliJ's configurations rather than having to manually change file permissions or create the folders that IntelliJ is trying to create itself.
Also, this error only happens until the files exist, after that it doesn't have the problem anymore.
All suggestions and help are appreciated, thanks!
Please sign in to leave a comment.
Please report a bug at https://youtrack.jetbrains.com/newIssue?project=IDEA with the logs attached via Help | Collect Logs and Diagnostic Data.
What WSL version and Linux distribution do you use?
I'm using WSL 1 (version 4.4.0) via Ubuntu.
It was a permissions issue, see https://youtrack.jetbrains.com/issue/IDEA-272489#focus=Comments-27-4991329.0-0.
Use the touch command. A Unix command known as touch creates a new file if one doesn't already exist or modifies the timestamp of an existing file. Simply start a WSL terminal and enter the following command to create an empty file using the touch command:
filename.txt touch
Filename.txt will be the name of the newly created empty file.
Use the command echo. A Unix command called echo prints text to the console. Simply open a WSL terminal and enter the following command to create an empty file using the echo command:
echoes to "filename.txt"
Thank You.
I run the Ubuntu Linux operating system and WSL 2. The most recent Windows Subsystem for Linux version, WSL 2, offers higher performance and compatibility than WSL 1. One of the most widely used Linux distributions, Ubuntu is renowned for its user-friendliness and extensive software support.
I can use Windows to view the Linux filesystem and execute Linux commands. This enables me to use a range of Linux tools and programs, including the Python programming language, the Bash shell, and Git.
Though I'm still growing, I learn something new every day. I'm eager to see what the future of WSL and Linux holds, and I'm devoted to giving my users the greatest experience imaginable.