Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Exclusion Paths #1

Open
mtotheikle opened this issue Apr 12, 2012 · 5 comments
Open

Add Exclusion Paths #1

mtotheikle opened this issue Apr 12, 2012 · 5 comments

Comments

@mtotheikle
Copy link
Owner

After discussion with James, we would like to be able to control/add exclusion paths so that the scan does not have to go through every file/folder.

Need more details on how we should implement this.

@sturakov
Copy link
Collaborator

Greetings everyone,

I just wanted to post a few musings about this issue and my understanding of it.

Adding exclusion paths via GUI...Perhaps a new form should be opened when the user clicks on to add Exclusion Paths?

Adding the paths themselves may be done via an openFileDialog, so the user can select the path via a file-dialog system and then the program could grab the path-string from the result. He could keep doing this and keep adding paths.

A dataGridViewer may be used to display all the paths in a nice list format.

Portability/Storage: I thought perhaps we could create a separate SQL table? The SQL table could store all the paths, but then the table would have to be installed alongside the program whenever the program is installed.
I'm not too entirely sure what would be the best way to handle this, let me know if you guys have any ideas.

When the scanner builds the directories to scan, there is a complexity problem.
They build the directories via tree-traversal. They use a stack to push a "root" directory and then they access the stack to push on all the "children" of the directories. This makes sense with the tree-structure of the file-system.
An issue might be on how to properly implement the checking of the exclusion paths and the paths that are added
to the stack. I think this might be cleverly solved.

The biggest issue, thus far, is actually comparing the paths.
I don't know if i'm having a silly issue with this, but i'm having a hard time comparing something like...
Say I want to exclude C:\ from the scans...Then C:\Users\Aleks should not be scanned right?

I'm having a hard time finding some way of saying these paths are "equal", that C:\ umbrellas anything afterwards..
C:*.

I'm researching this quite a bit, i'm sure i'll find some solution. I just wanted to provide an update on this issue.

@mtotheikle
Copy link
Owner Author

Good stuff here.

We can discuss it more Tuesday as far as the GUI stuff.

Some possible solutions might be from here http://stackoverflow.com/questions/2281531/how-can-i-compare-directory-paths-in-c

I would say we do want to avoid and file I/O when comparing paths as that will get expensive.

@sturakov
Copy link
Collaborator

I was actually looking at that post on stackoverflow when you posted it haha.

An update on what I'm doing:

I spent most of Saturday researching some ways to exclude paths. This, as I mentioned, will include comparing paths.
The link to stackoverflow was a good start, but it mentioned lexicographical comparisons.
This is an issue because comparing C:\ to D:\ will return a -1, because C:\ is lexicographically less than D:...
So depending on how the code is written, excluding the drive C:\ might also exclude the drive D:. I could explain this in more detail on Tuesday if needed.
Plus, I was going down the path of complicated sub-string parsing on comparing paths and other logical checks.
In a few words, not a good way to go.

But anyway, After a bunch of time spent testing and researching, I found a nice and simple solution.
It's kind of funny in an infuriating way that it was so simple and nice haha.

The good news: I'm fairly confident I can exclude paths correctly in the code, all I need now is the team-okayed GUI design on how to get the paths from the user and the okay to start editing the code.

@ghost ghost assigned sturakov Apr 23, 2012
@sturakov
Copy link
Collaborator

An update:

I believe I have successfully implemented the exclusion paths on top of the previous teams code.

I started up the scanner and went to the exclusion paths. I excluded all the drives on my computer except C:.
And for C:, I excluded C:\Windows and C:\Users\Aleks.

I then ran the scanner under Administrator mode.

The scan actually COMPLETED successfully, scanning a total of 3431 files, 1674 hits, and taking about 10 minutes.

I'm sure more testing is needed for greater robustness...But it actually scanned. So, i'm happy.

Some notes:
The GUI portion of exclusion paths may look funny on first start-up. I hard-coded an exclusion path automatically,
and added the method right after the initialization. It seems the initialization method is still doing stuff when my method is called, i'm not sure if it's some internal threading thing or what..But activating the GUI again fixes the small graphical error.

Future improvements:
The way the directories are gathered may have to be re-written, as discussed in class. This would be mainly to reduce memory usage and improve scanning time.

@sturakov
Copy link
Collaborator

Except for more testing, general bug finding, and possibly GUI improvements.. I believe this issue may be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants