取出路径中的文件名
取出路径中的文件名
open System.IO
let rec allFilesUnder basePath =
seq {
yield! Directory.GetFiles(basePath)
for subdir in Directory.GetDirectories(basePath) do
yield! allFilesUnder subdir
}
allFilesUnder @"c:\"
|> Seq.take 10
|> Seq.toList
|> List.map (fun i -> i.Substring(i.LastIndexOf(@"\")+1))