Subscribe to RSS

Some rights reserved

Except where otherwise noted, content on this site is licensed under a Creative Commons License


programming‎ > ‎java‎ > ‎

link4java

As you probably known Java 1.6 does not provide such low level access to the file system. NIO 2, which should be included in Java 1.7, will have support for symbolic links. Symbolic links are mentioned there, creating and following them is possible. 

But with Java 6 how you can solve the problem?

I've tried with JNA, the solution is very simple, for windows we use CreateHardLinkA, for linux I use link syscall. This is still suboptimal but it is very simple and good enough (good enough software is a sort of design pattern).

I'm don't sure about including symlinks in both windows (using the new API CreateSymboliclink, available only on Vista) and symlink for linux. 

Here is my experimental API. What do you think about?