Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Need script to fix C++ "#include" statements (http://www.velocityreviews.com/forums/t891521-need-script-to-fix-c-include-statements.html)

Ed J 03-24-2005 07:00 PM

Need script to fix C++ "#include" statements
 
I'm porting a large Windows C++ application to Linux and ran into a big
hassle because of the case-sensitivity of filenames.

Does anyone want to take a shot at writing a Perl script to fix filenames
used in "#include" statements?

1. Search a directory tree for all *.h files, and remember their names.
2. Scan the same directory tree for all *.[CcPpPp] files, and replace the
filenames in their "#include" statements with the case-insensitive matching
name. Include files are distributed in several folders. When not in the
same folder as the including source file, it uses the ".." conventions for
relative path traversing.
3. Also change any backslashes in the filenames to forward slashes.

I know a pro could write such a script in two minutes. I use Perl once a
year. It would take me two hours at least!

Thanks bunches!!
Ed



John Bokma 03-24-2005 07:22 PM

Re: Need script to fix C++ "#include" statements
 
Ed J wrote:

> I know a pro could write such a script in two minutes.


I doubt you would find anyone who could do it in two minutes.

> I use Perl
> once a year. It would take me two hours at least!


I think it will take a pro at least one hour, maybe two including good
testing, getting your files, and making the invoice.

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html


Paul Lalli 03-24-2005 07:33 PM

Re: Need script to fix C++ "#include" statements
 
Ed J wrote:
> I'm porting a large Windows C++ application to Linux and ran into a big
> hassle because of the case-sensitivity of filenames.
>
> Does anyone want to take a shot at writing a Perl script to fix filenames
> used in "#include" statements?
>
> 1. Search a directory tree for all *.h files, and remember their names.
> 2. Scan the same directory tree for all *.[CcPpPp] files, and replace the
> filenames in their "#include" statements with the case-insensitive matching
> name. Include files are distributed in several folders. When not in the
> same folder as the including source file, it uses the ".." conventions for
> relative path traversing.
> 3. Also change any backslashes in the filenames to forward slashes.
>
> I know a pro could write such a script in two minutes. I use Perl once a
> year. It would take me two hours at least!


I'm afraid you've posted to the wrong place. This group is for people
who want help writing their own Perl scripts, not for people to get
scripts written for them.

For the latter, you will have better luck at somewhere such as jobs.perl.org

For the former, please do feel free to make a stab at your task, and if
you encounter problems, let us know what they are so we can help you.

Paul Lalli

Tad McClellan 03-24-2005 09:04 PM

Re: Need script to fix C++ "#include" statements
 
Ed J <jed@privacy.net> wrote:

> Does anyone want to take a shot at writing a Perl script to fix filenames



> I know a pro could write such a script in two minutes. I use Perl once a
> year. It would take me two hours at least!



How much does this job pay?


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

robic@yahoo.com 04-07-2005 09:01 AM

Re: Need script to fix C++ "#include" statements
 
On Thu, 24 Mar 2005 15:04:31 -0600, Tad McClellan
<tadmc@augustmail.com> wrote:

>Ed J <jed@privacy.net> wrote:
>
>> Does anyone want to take a shot at writing a Perl script to fix filenames

>
>
>> I know a pro could write such a script in two minutes. I use Perl once a
>> year. It would take me two hours at least!

>
>
>How much does this job pay?


More than your newspaper route...


profmath.developers@gmail.com 04-08-2005 03:07 AM

Re: Need script to fix C++ "#include" statements
 

Ed J wrote:
> I'm porting a large Windows C++ application to Linux and ran into a

big
> hassle because of the case-sensitivity of filenames.

....
> I know a pro could write such a script in two minutes. I use Perl

once a
> year. It would take me two hours at least!
>
> Thanks bunches!!
> Ed


It would probably take a lot less time for you to program it then for
you to just sit around waiting for someone to quickly send you an email
saying "Don't worry! I've made your program for nothing because I
really want to to succeed in life, and I want you to learn how to
program like a 'pro'!"



All times are GMT. The time now is 10:24 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.