|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Removing smbolic linksHello All,
Sometimes when I execute my clean target it fails because files can't be deleted. For example, if I have a build file that looks as follows: <?xml version="1.0"?> <project name="sym" default="build" basedir="."> <target name="build"> <touch file="foo.so" /> <exec program="/bin/ln"> <arg line="-s /home/aha/devel/nant/foo.so foo.so.0" /> </exec> </target> <target name="clean"> <delete file="/home/aha/devel/nant/foo.so" /> <delete file="/home/aha/devel/nant/foo.so.0" /> </target> </project> And then execute it as follows: [aha@charm nant]$ nant NAnt 0.85 (Build 0.85.2478.0; release; 10/14/2006) Copyright (C) 2001-2006 Gerry Shaw http://nant.sourceforge.net Buildfile: file:///home/aha/devel/nant/sym.build Target framework: Mono 2.0 Profile Target(s) specified: build build: BUILD SUCCEEDED Total time: 0.1 seconds. [aha@charm nant]$ ls foo.so foo.so.0 sym.build sym.build~ and finally execute the clean target: [aha@charm nant]$ nant clean NAnt 0.85 (Build 0.85.2478.0; release; 10/14/2006) Copyright (C) 2001-2006 Gerry Shaw http://nant.sourceforge.net Buildfile: file:///home/aha/devel/nant/sym.build Target framework: Mono 2.0 Profile Target(s) specified: clean clean: [delete] Deleting file /home/aha/devel/nant/foo.so. [delete] Deleting file /home/aha/devel/nant/foo.so.0. BUILD FAILED /home/aha/devel/nant/sym.build(11,6): Cannot delete file '/home/aha/devel/nant/foo.so.0'. Could not find file "/home/aha/devel/nant/foo.so.0" Total time: 0 seconds. Now I know that Windows does not support symbolic links, and from looking at the source code the problem is that System.IO.FileInfo.Exsits is false for symbolic links. And DeleteTask.cs contains the line of code: if (!deleteInfo.Exists) { return; } Which causes the function to exit before actually deleting the file, I didn't follow the trail any farther than that, but I was wondering if anyone new if NAnt 0.86 supports the deletion of symbolic links? I've been thinking about a couple of implementations using Mono, however, it requires the use of a Library that is not Standard in the .NET Framework, namely Mono.Unix.Native (yes I know it's been deprecated). Anyway, I am just wondering what others have tried. -- Aquil H. Abdullah aquil.abdullah@... ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ NAnt-users mailing list NAnt-users@... https://lists.sourceforge.net/lists/listinfo/nant-users |
|
|
Re: Removing smbolic linksAquil, This should work using a recent version of Mono (built from SVN
HEAD). Gert From:
nant-users-bounces@...
[mailto:nant-users-bounces@...] On Behalf Of Aquil H.
Abdullah Hello All, ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ NAnt-users mailing list NAnt-users@... https://lists.sourceforge.net/lists/listinfo/nant-users |
|
|
|
| Free Forum Powered by Nabble | Forum Help |