I am trying to access a file on my MacBook Pro via a web app running on Tomcat in Eclipse (localhost). Whenever I try to access the file I receive the following IO Exception:
Exception: /private/var/appname/app_config.txt (No such file or directory)
This file does exist and when I use Apple+I
the file info window gives this location:
/private/var/appname
So why does the web app get the (No such file or directory) exception? How do I get the real path if the file info window isn't valid via web app?
EDIT
The permissions on the file in questions are:
-rw-r--r--
where the owner is the user context the web app is running under, which is determined by entering the following into the shell:
ps axu -w
Permissions on the directory appname
are as such:
drwxr-x---
where again, the owner is the user context the web app is running under.
And finally, the directory var
has permissions:
drwxr-xr-x
with root as owner.
Furthermore, removing private
from the path results in the exact same exception, sans the private
in the path:
Exception: /var/appname/app_config.txt (No such file or directory)
/private/var/log/system.log
, and if you're using Apache with Tomcat you may need to configure it. – l'L'l Jan 23 '14 at 22:06