在java中创建硬链接 [英] Creating a Hard Link in java

查看:775
本文介绍了在java中创建硬链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我通过 Runtime.exec()使用' ln '命令。它工作正常。唯一的问题是,为了做这个fork,我们需要两倍的应用程序堆空间。我的应用程序是一个64位的应用程序,堆大小约10Gigs,因此它的交换空间耗尽。我找不到任何可以解决此问题的配置。

Currently I use 'ln' command via Runtime.exec(). It works fine. The only problem is that in order to do this fork, we need twice the heap space of the application. My app is a 64 bit app with heap size around 10Gigs and thus its runs out of swap space. I couldn't find any configuration that could fix this.

我也不想使用JNI。
我也听说过这个设施很快将在java 7中提供。

I also want not to use JNI for the same. Also I had heard somewhere that this facility will soon be provided in java 7.

推荐答案

你可以试试 JNA 代替JNI(JNA比JNI有明显的优势);是的,请查看 JSR 203

you could try JNA in place of JNI (JNA has some clear advantages over JNI); yes, check the JSR 203

这篇关于在java中创建硬链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆