我有一个小的测试脚本来重现问题
// include Fake lib
#r @"tools\FAKE\tools\FakeLib.dll"
open Fake
let root = @"\\wgprintsrv\FTP\FTPSoftware\FTPSW\weincad\release"
let glob = root @@ "**\*.dll"
trace glob
!! glob
|> Seq.iter (fun file -> trace file )
它没有列出任何内容。只是检查以下powershell命令
ls -R \\wgprintsrv\FTP\FTPSoftware\FTPSW\weincad\release -Filter *.dll
生成我期望的一切。如果我用本地相对路径替换UNC路径,那么一切正常。这可能会解决吗?或者它是UNC路径和F#globbing的核心问题吗?
答案 0 :(得分:1)
用户不太友好但是glob不能识别绝对路径。您必须像这样设置基本目录
// include Fake lib
#r @"tools\FAKE\tools\FakeLib.dll"
open Fake
let root = @"\\wgprintsrv\FTP\FTPSoftware\FTPSW\weincad\release"
let glob = "**\*.dll"
trace glob
!! glob
|> SetBaseDir root
|> Seq.iter (fun file -> trace file )