Hi Rajesh,

I tried getCanonicalFile() on Windows xp , it does not resolve symbolic/hard links.

Does the comparision u mentioned works on Linux if there are hard links ?

Quick scan at the java doc for  getCanonicalFile()/getCanonicalPath():
"This typically involves removing redundant names such as "." and ".." from the pathname, resolving symbolic links (on UNIX platforms), and converting drive letters to a standard case (on Microsoft Windows platforms)."


Thanks
-suresht.


Rajesh Kartha (JIRA) wrote:
[ http://issues.apache.org/jira/browse/DERBY-304?page=comments#action_12364919 ]
Rajesh Kartha commented on DERBY-304:
-------------------------------------

The (file.getCanonicalFile()) gives you the actual path for symbolic links. I 
am wondering  if that could be used to compare the
backup location and the actual database to be the same.
Something like:

f.getCanonicalFile().equals(f1.getCanonicalFile())

This will return true is'f1' is a symbolic link to 'f'. I know for sure this 
works on Linux.


-Rajesh




If by mistake you give he location for the db backup as the db itself , then 
windows created directories recursively until windows crashes!
-------------------------------------------------------------------------------------------------------------------------------------------

        Key: DERBY-304
        URL: http://issues.apache.org/jira/browse/DERBY-304
    Project: Derby
       Type: Bug
 Components: Store
   Versions: 10.1.1.0
Environment: With JDK 142 on Windows XP
   Reporter: Manjula Kutty
   Priority: Minor


If by mistake you give he location for the db backup as the db itself , then windows created directories recursively until it crashes! Repro:
                        CallableStatement cs = conn.prepareCall("CALL 
SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(?, ?)");
                        cs.setString(1, "c:/maildb");
                        cs.setInt(2, 1);
                        cs.execute();
                        cs.close();
result:
C:\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\.....................
 Until windows can not show the path!!!



Reply via email to