Home>
When specified as File.exist ("C: \ tmp \ test") in Windows (local), the directory exists properly (true is returned)
Why is there a directory that does not exist (False) if I specify File.exist ("/ opt/test") in Centos?
Both should have directories ...
I would like to know if you know anything.
File dir = new File ("/ opt/test");
// File dir = new File ("C: \\ tmp \\ test");
If (! Dir.exists ()) {
return "Dir Not Exist";
}
Supplemental information (FW/tool version etc.)
Java Windows10 Centos7
AppendI'm not sure how to paste the image.
The actual source and the one presented here were slightly different.
I'm sorry that I put the full-width space in order to match the appearance.
The actual source is
It's like this, I didn't see it, but when I pasted it into a text editor
File dir = new File ("/ opt/scanup");
// File dir = new File ("C: \\ tmp \\ test \\ uptest");
if (! dir.exists ()) {
return "Dir Not Exist";
}
It seems that tab is in the part that specifies the path like this.
Tabs deleted
File dir = new File ("/ opt/scanup");
// File dir = new File ("C: \\ tmp \\ test \\ uptest");
if (! dir.exists ()) {
return "Dir Not Exist";
}
It worked as expected.
-
Answer # 1
Related articles
- java - server migration (windows> ubuntu)
- wsl (windows subsystem for linux) - are there any disadvantages to programming on a gaming pc?
- when executing the java source code with windows powershell, garbled characters will occur with specific characters (hiragana)
- linux - [centos7] after accessing the samba server from windows, the shared folder path specified in smbconf is not displayed on
- linux - [centos7] after accessing the samba server from windows, the shared folder path specified in smbconf is not displayed on
- i want to use an old windows pc as a file server on linux which linux is better?
- linux - [centos 7] connection timed out at the windows command prompt after starting the ftp server
- linux - moving vim split windows
- java - please tell me how the program works
- wsl (windows subsystem for linux) - possible problems with cooperation between windows side and wsl2 side
- i don't understand how linux/etc/crontab works
- i want to use the linux tree command on a windows vs code terminal
- upgrade to windows 10 python no longer works
- i can't use firefox and chrome on windows subsystem for linux
- i want to install android studio for linux on windows using ubuntu (bash)
- java - to output tomcat gc log on windows
- i want to call windows explorer from java, but it doesn't work
- wsl (windows subsystem for linux) - when i copy a file from windows to the wsl directory using ubuntu wsl, it says access denied
- java - i cannot solve the error when it works normally
Related questions
- java - i want to start the service implemented by spring boot on sakura vps (centos 8) and display it on the browser
- java - i want to put the site created by spring boot on sakura vps and omit 8080 from the url
- Launching Java file from IJ
- i want to perform an operation on a file whose ownership is apache as another user without using sudo, but i can't
- linux - please tell me about the architecture of snmp
- linux - yum command fails [error: cannot find a valid baseurl for repo: base]
- linux - how to operate openldap
- linux/dns server construction named error
- i want to install mod_header on apache
- linux - what are the disadvantages of using an unsupported free os such as centos as the production server?
There are many possibilities.
1. There is a mistake in the part that is not written here
2. What is written here is different from what is executed
3. Directory does not exist (typo, mistyping, etc.)
Since there is a double-byte space, it's a compile error. In a program that is not running?