In my Java application , I am running following command to get the Octal permission and file name.
stat -c "%a %n" <file name>
This command works on Linux but the Solaris version I have doesnt have stat command supported.
How can I achieve this with a command which works on both Linux and Solaris There are some options with perl stat but unfortunately I cant use perl.