Count files without hidden files

Advertisement

matoui
Joined:
Posts:
2

Count files without hidden files

Hello,

I'd like to count numbers of files without hidden files in the server before to download them.
I use version 5.17.7 with C#
I must use the mask here?
var allFiles = session.EnumerateRemoteFiles(dossierDepot.FullName, null, EnumerationOptions.AllDirectories);
nbrFilesInFTP = allFiles.Count();
thanks

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
38,408
Location:
Prague, Czechia

Re: count files without hidden files

var nonHiddenFiles = allFiles.Where(_ => !_.Name.StartsWith('.'));
nbrFilesInFTP = nonHiddenFiles.Count();
(untested)

Reply with quote

Advertisement

You can post new topics in this forum