commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Attila Szegedi (JIRA)" <>
Subject [jira] Commented: (IO-168) Symbolic links (symlinks) followed when deleting directory.
Date Mon, 28 Jul 2008 11:43:31 GMT


Attila Szegedi commented on IO-168:



won't return true only for a symlink. It will also return true for a file that has at least
one symlinked directory in its path.

This will work as expected though:

File canonicalDir = file.getParentFile().getCanonicalFile();
File fileInCanonicalDir = new File(canonicalDir, file.getName());
return fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile());


> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>                 Key: IO-168
>                 URL:
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called
on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without
altering the contents of 'dir' (or 'dir' itself).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message