Results 1 to 2 of 2
- 07-28-2009, 04:07 PM #1
Member
- Join Date
- Dec 2008
- Posts
- 99
- Rep Power
- 0
ignore links when building file tree
Hi
I'm building file system with java trees.
I want to recognize if the file is symolic linlk - i didn't find an y methdos such as "File.isLink" - any idea how should i do it ?
otherwise its become the running time become huge.. ( I program so it will stop if there will be loops but still it take lot of time )
- 07-28-2009, 06:41 PM #2
From google:
"The fix to the faulty algorithm sounds easy: Never descend into a directory via a symbolic link. Always simply delete symlinks, no matter if they reference directories or files. With that in mind, you check the API of java.io.File for the isLink() method, just to find out... It does not exist! Right, the ability to identify links is missing and that has been an issue with Java for years. It is a problem, currently being worked on by JSR 203, but a solution will not be available till Java SE 7. So in the meantime, a work around is required and this means doing dirty work using JNI (Java Native Interface)."
Here is a link:
How to deal with filesystem softlinks/symbolic links in Java | Onyxbits
Similar Threads
-
help me..how to get links in html file
By thangbomlennet in forum New To JavaReplies: 13Last Post: 11-03-2012, 05:31 PM -
Help loading a Binary Tree from file
By ExplosiveWeasel in forum Java 2DReplies: 16Last Post: 12-17-2008, 01:34 AM -
help needed regarding tree building
By invincible_me in forum New To JavaReplies: 2Last Post: 08-12-2008, 01:44 PM -
building file and variable names from variables
By madad2005 in forum New To JavaReplies: 2Last Post: 07-18-2007, 04:47 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks