如果有人在 Windows (NTFS) 上运行 Ant 符号链接任务会发生什么? [英] What happen if someone run Ant symlink task on Windows (NTFS)?

查看:37
本文介绍了如果有人在 Windows (NTFS) 上运行 Ant 符号链接任务会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了 ant 构建脚本.我需要创建一个符号链接,我找到了 symlink 任务.根据手册,它仅适用于 Unix.如果有人在 Windows 平台上运行我的构建脚本会发生什么?构建会失败吗?或者这个任务在windows平台上会被忽略?或者在 NTFS 驱动器的情况下,它甚至可以工作?

I write ant build script. I need to create a symlink and I found symlink task. According to manual, it works only on Unix. What happens if someone run my build script on windows platform? Will build fail? Or this task will be ignored on windows platform? Or in case of NTFS drive, it will even work?

推荐答案

我运行的是 Win7,我试过了.因为我已经安装了 Mingw,所以它使用了 ln.ln 似乎只是复制一切.由于正常的 Windows 安装没有 ln,它会在那里失败.

I'm running Win7 and I tried it. Since I have Mingw installed it used ln. Ln seemed just to copy everything. Since a normal Windows installation does not have ln, it would fail there.

以下是没有 ln 的情况:

Here's what happens without ln:

C:\Users\Janus\Desktop>.\apache-ant-1.8.2\bin\ant
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
Buildfile: C:\Users\Janus\Desktop\build.xml

dist:

BUILD FAILED
C:\Users\Janus\Desktop\build.xml:3: Could not launch ln: java.io.IOException: Cannot run program "ln": CreateProcess error=2, The system can
not find the file specified

Total time: 1 second

C:\Users\Janus\Desktop>

Build.xml:

<project name="MyProject" default="dist" basedir=".">
<target name="dist">
<symlink link="lol" resource="d3dwindower" />
</target>
</project>

这篇关于如果有人在 Windows (NTFS) 上运行 Ant 符号链接任务会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆