Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 为什么Fake/F#globbing在UNC路径上不起作用_Powershell_F#_Glob_Unc_F# Fake - Fatal编程技术网

Powershell 为什么Fake/F#globbing在UNC路径上不起作用

Powershell 为什么Fake/F#globbing在UNC路径上不起作用,powershell,f#,glob,unc,f#-fake,Powershell,F#,Glob,Unc,F# Fake,我有一个小的测试脚本重现了这个问题 // 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 ) 它没有

我有一个小的测试脚本重现了这个问题

// 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的核心问题?

用户不太友好,但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 )

我不认为你的代码做了你认为它做的。SetBaseDir不是命令式语句。正如您在上所看到的,它接受一个globbing语句并返回一个修改后的语句。“SetBaseDir root”根本不起作用。确认了这个答案<代码>!!(uncpath@@“***”)\124;>SetBaseDir uncpath|>Seq.iter trace有效,但
!!(uncpath@“***”)Seq.iter trace
无效。是的,这可能有一个错误。请在创建一个问题,我将尝试修复它。