Skip to content

Instantly share code, notes, and snippets.

@sergey-tihon
Created June 7, 2012 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergey-tihon/2888161 to your computer and use it in GitHub Desktop.
Save sergey-tihon/2888161 to your computer and use it in GitHub Desktop.
open System.IO;
let rec getAllDirectories dir =
Directory.GetDirectories(dir)
|> Array.collect getAllDirectories
|> Array.append [|dir|]
let directoryName = System.Environment.GetCommandLineArgs().[1]
let wrongOpprtunities =
directoryName
|> getAllDirectories
|> Array.filter (fun dir -> dir.EndsWith("output", System.StringComparison.InvariantCultureIgnoreCase))
|> Array.filter (fun dir ->
let final = Path.Combine(dir, "final")
not (Directory.Exists(final)) || Directory.GetFiles(final).Length = 0)
|> Array.map (fun name -> name.Substring(directoryName.Length))
File.WriteAllLines("WrongOpprtunities.txt", wrongOpprtunities);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment