I fear you will never get a solution that extracts all c-files, and no others... no matter how hard you work.
That's why you should spend more time with your friend first (as suggested by GrandFather):
- how fault-tolerant should your solution be? (e.g. a 90%-detection-rate might be fine)
- is it more desirable to have false positives (files wrongly classified being in C) of false negatives (C files that have been missed)?
- what is the environment (how likely are people using "wrong" extensions, e.g. a perl-script in a .c-file)
- how fast should your solution be? (e.g. is it acceptable to do a lot of plausi-checks on that hundreds of 20-MB-.cpp-files to ensure that none of them is in reality C?)
In my experience, the time used to understand the use-case of your customer and to investigate with him where it is possible to "cut corners"
is well invested. It will give you the possibility for easier solutions, and lead to higher customer satisfaction.
And less change-requests afterwards ...
HTH, Rata
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|