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

Discussion in 'Perl Misc' started by Ed J, Mar 24, 2005.

  1. Ed J

    Ed J Guest

    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
    Ed J, Mar 24, 2005
    #1
    1. Advertising

  2. Ed J

    John Bokma Guest

    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
    John Bokma, Mar 24, 2005
    #2
    1. Advertising

  3. Ed J

    Paul Lalli Guest

    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
    Paul Lalli, Mar 24, 2005
    #3
  4. Ed J <> 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
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Mar 24, 2005
    #4
  5. Ed J

    Guest

    On Thu, 24 Mar 2005 15:04:31 -0600, Tad McClellan
    <> wrote:

    >Ed J <> 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...
    , Apr 7, 2005
    #5
  6. Ed J

    Guest

    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'!"
    , Apr 8, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Xah Lee
    Replies:
    22
    Views:
    1,123
    Tim Roberts
    Mar 21, 2006
  2. Danny Anderson
    Replies:
    5
    Views:
    497
    Victor Bazarov
    Aug 15, 2003
  3. Xah Lee
    Replies:
    23
    Views:
    1,067
    Tim Roberts
    Mar 21, 2006
  4. Andreas Bogenberger
    Replies:
    3
    Views:
    904
    Andreas Bogenberger
    Feb 22, 2008
  5. Xah Lee
    Replies:
    21
    Views:
    785
    Tim Roberts
    Mar 21, 2006
Loading...

Share This Page