Nicolai, Kurt will probably answer better than I can later on, but I believe that the problem with getCanonicalPath is that it does not handle symbolic links correctly on Unix. Something about getting out of the ‘symlink farm’ if my memory serves me right (I never fully understood the issue completely ;-).

 

In your case, since you’re on XP, getCanonicalPath would work IMHO. You might want to use it consistently in the code though, as in the past another problem was having a mixture of getCanonicalPath and getAbsolutePath. –DD

 

PS: Your names are exceedingly long indeed…

 

-----Original Message-----
From: ant-contrib-developers-admin@lists.sourceforge.net [mailto:ant-contrib-developers-admin@lists.sourceforge.net] On Behalf Of Nicolai Henriksen
Sent: Tuesday, June 07, 2005 6:08 AM
To: 'ant-contrib-developers@lists.sourceforge.net'
Subject: [Ant-contrib-developers] cpptasks: Problem with long paths on win32 - error in DependencyT able ?

 

I am not sure this is the right place to ask but I think it is:

I compile using cpptasks on Windows XP. We have some pretty long paths and file-names and during re-compile I get a java.io.FileNotFoundException.

The problem is in the dependency analysis. The error produced look like this:

   [cc.exe] Error parsing \pro\LIBase\AirportDepartureAllocation\DepartureAllocationTemplateEditorService\win32.release.ora101\obj\..\..\..\..\..\..\home\nhe\LIBase\AirportDepartureAllocation\DepartureAllocationTemplateEditorService\LoadExistingTemplateFunctionAllocationsRequestMsg.h:java.io.FileNotFoundException: \pro\LIBase\AirportDepartureAllocation\DepartureAllocationTemplateEditorService\win32.release.ora101\obj\..\..\..\..\..\..\home\nhe\LIBase\AirportDepartureAllocation\DepartureAllocationTemplateEditorService\LoadExistingTemplateFunctionAllocationsRequestMsg.h (The system cannot find the path specified)

From a command prompt the command
  dir \pro\LIBase\AirportDepartureAllocation\DepartureAllocationTemplateEditorService\win32.release.ora101\obj\..\..\..\..\..\..\home\nhe\LIBase\AirportDepartureAllocation\DepartureAllocationTemplateEditorService\LoadExistingTemplateFunctionAllocationsRequestMsg.h

fails with the error "The filename or extension is too long."

So the problem seems to be that the generated filename is too long for Windows to  handle. As I see it the generated filename is way longer than necessary, but I do not understand the cpptasks code good enough to exactly know why.

I do not know how or why but if I add a call to getCanonicalFile() to net.sf.antcontrib.cpptasks.DependencyTable line 527 it seems to solve the problem.

Is this the right solution?

Any suggestions?

 - Nicolai
---
Nicolai Henriksen, phone: +45 51 23 87 07


This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.