Comments (1)
I know this is not exactly what you want, but I made a few changes to exclude folders (not files) from an exclude file.
-
Add nuget package DotNet.Glob at https://www.nuget.org/packages/DotNet.Glob/3.0.9
-
frmMain.cs
public partial class frmMain : Form
{
...
private void frmMain_Load( object sender, EventArgs e )
{
...
if( System.IO.Directory.Exists( txtRoot.Text ) )
{
SetRootPath( txtRoot.Text , true);
}
else
{
SetRootPath( "" , false );
}
LoadExcludeFolders();
txtLinkRoot.Enabled = chkLinkFiles.Checked;
...
- frmMain_Helpers.cs
public partial class frmMain : Form
{
private static List<Glob> _globs = new List<Glob>();
private void LoadExcludeFolders()
{
GlobOptions.Default.Evaluation.CaseInsensitive = true;
string line;
using (var streamReader = new StreamReader(@"Exclude_List.txt"))
{
while ((line = streamReader.ReadLine()) != null)
{
if (string.IsNullOrWhiteSpace(line)) continue;
_globs.Add(Glob.Parse(line));
}
}
}
...
// Recursive function to get all folders and subfolders of given path path
public void DirSearch( string sDir, List<string> lstDirs, bool skipHidden, bool skipSystem, Stopwatch stopwatch )
{
if( backgroundWorker.CancellationPending ) return;
try
{
foreach( string d in System.IO.Directory.GetDirectories( sDir ) )
{
bool includeThisFolder = true;
foreach (var glob in _globs)
{
if ( glob.IsMatch(d) )
{
includeThisFolder = false;
break;
}
}
// exclude folders that have the system or hidden attr set (if required)
if ( skipHidden || skipSystem )
{
...
- Add the exclude file named
Exclude_List.txt
in same folder containing exe.
Use glob pattern to specify folders. For example:
**\node_modules
will exclude any node_modules
folders. ** matches any number of subfolders.
from snap2html.
Related Issues (20)
- Update "open folder selection dialog box" HOT 3
- List only folders
- Suggestion for template: sticky header
- Merging multiple html’s HOT 8
- Support pasting directory HOT 1
- Display the relative or absolute path to the file in the file information field HOT 2
- Make HTML mobile friendly HOT 2
- [Possible Bug] Does Not Create HTML File of Complete Folder (Posssibly Due to Size Limit) HOT 8
- Path HTML decode bug
- The html is too big to open very slowly HOT 3
- Is there a way to automatically run snap2html? HOT 1
- Incomplete report generation (Missed 90% of the folders) HOT 4
- Snap2HTML does not like long paths HOT 2
- Suggestion / Request: File path on mouse-over in the search results
- Suppress path in url HOT 1
- error with persian name with space in command line HOT 1
- date format in 2.14 HOT 1
- Suggestion / Request: Remove full path when 'link files' is disabled HOT 2
- How do I fill a single-digit date with "0"? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snap2html.