3

I have a small test script reproducing the problem

// 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 )

it lists nothing. Just to check the following powershell command

ls -R \\wgprintsrv\FTP\FTPSoftware\FTPSW\weincad\release -Filter *.dll

generates everything I expect. If I replace the UNC path with a local relative path then everything works. Is this possible to work around or is it a core problem with UNC paths and F# globbing?

bradgonesurfing
  • 30,949
  • 17
  • 114
  • 217
  • Yes this might have a bug. Please create an issue at https://github.com/fsharp/FAKE/issues and I'll try to fix it. – forki23 Jul 08 '14 at 09:32

1 Answers1

1

Not too user friendly but the glob doesn't recognize absolute paths. You have to set the base directory like so

// 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 )
bradgonesurfing
  • 30,949
  • 17
  • 114
  • 217
  • I don't think your code does what you think it does. SetBaseDir is not an imperative statement. As you can see at https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/Globbing/FileSystem.fs#L131 it takes a globbing statement and returns a modified one. "SetBaseDir root" does nothing at all. – forki23 Jul 08 '14 at 09:25
  • Confirmed this answer. `!! (uncpath @@ @"**\*) |> SetBaseDir uncpath |> Seq.iter trace` works but `!! (uncpath @@ @"**\*") |> Seq.iter trace` does not. – brianary Sep 18 '14 at 21:42