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

E

Ed J

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
 
J

John Bokma

Ed said:
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.
 
P

Paul Lalli

Ed said:
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
 
T

Tad McClellan

Ed J said:
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?
 
P

profmath.developers

Ed said:
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'!"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top