Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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