You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by levi levi mail <le...@gmail.com> on 2010/05/19 14:27:37 UTC

[io] FileSystemUtils.freeSpaceKb on unix gives OS error

Hi,

I'm testing an app on Windows and Unix with commons-io-1.4.jar
On Windows calculating the freeSpace is OK,
but on Unix I get the following error.
Executing 'df -k' manually on the machine works as expected. Too bad we
don't see a better error description. Does anyone have any hints where to
look for the problem? Maybe userrights?

java.io.IOException: Command line returned OS error code '1' for command
[df, -k, ]
at
org.apache.commons.io.FileSystemUtils.performCommand(FileSystemUtils.java:419)
at
org.apache.commons.io.FileSystemUtils.freeSpaceUnix(FileSystemUtils.java:323)
at
org.apache.commons.io.FileSystemUtils.freeSpaceOS(FileSystemUtils.java:196)
at
org.apache.commons.io.FileSystemUtils.freeSpaceKb(FileSystemUtils.java:166)

Re: [io] FileSystemUtils.freeSpaceKb on unix gives OS error

Posted by GMail <st...@gmail.com>.
Hello levi,

That's a the only description that you might get - external process exited with error.

What kind of UNIX do you have?

Check what environment java process has (PATH and other variables
might be different for logged in user and process), what is the
directory where process is running.

Wednesday, May 19, 2010, 8:27:37 AM, you wrote:
> Hi,

> I'm testing an app on Windows and Unix with commons-io-1.4.jar
> On Windows calculating the freeSpace is OK,
> but on Unix I get the following error.
> Executing 'df -k' manually on the machine works as expected. Too bad we
> don't see a better error description. Does anyone have any hints where to
> look for the problem? Maybe userrights?

> java.io.IOException: Command line returned OS error code '1' for command
> [df, -k, ]
> at
> org.apache.commons.io.FileSystemUtils.performCommand(FileSystemUtils.java:419)
> at
> org.apache.commons.io.FileSystemUtils.freeSpaceUnix(FileSystemUtils.java:323)
> at
> org.apache.commons.io.FileSystemUtils.freeSpaceOS(FileSystemUtils.java:196)
> at
> org.apache.commons.io.FileSystemUtils.freeSpaceKb(FileSystemUtils.java:166)

-- 
Best regards,
 Alex                            mailto:student00x@gmail.com


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org