To perform operations with Directory
Dear All,
I am new to Begineer in C programming..i am working for one Software Firm..my problem can be devided as follows
1. I have one folder in any drive it contains both Source files(.C) and Header
files(.H) i should get copy of this folder into my current working directory
2. I should separate both .C and .H files
3. In .C files there are preprocessor directives like #include "CAN.h" i have to convert this into lower case like #include "can.h"
Can any body help to solve this?? Thanks in advance
Hai Mats could you help??
Quote:
Originally Posted by
matsp
"plain" would be a bit excessive, I think.
But the above code is certainly useful as a base for how to do it in C - most of it is straightforward in translating. If you don't understand the Perl, then it's not that much help, of course.
--
Mats
Hai Mats
Please can you translate above code into C programming..i am good in C programming but not in PERL...i am in urgent with this peace of code..can you give equavalent code for above
PERL code in C programming
Still i am getting following error..
Quote:
Originally Posted by
Salem
What possible motivation would there be for converting a perfectly usable (and short) perl script into a whole mass of C code?
If you're thinking it will be a lot faster, then it won't be. The code is so heavily bound to the file system that the same constraints which affect perl (which is itself written in C) will also affect any native C program.
> post 1 - I am new to Begineer in C programming
> post 6 - i am good in C programming but not in PERL
Mmm'kay, which is it?
> i am in urgent with this peace of code..can you give equavalent code for above PERL code in C programming
That might take the competent amongst us at least a day to write, debug and test and run to many hundreds of lines of code. It might take you with lots of help a couple of weeks to get there.
Oh, and the . in /.([chCH])$/ should be /\.([chCH])$/ if you really only want files which end in [chCH] and not just any old filename like say file.pch
Global symbol "$path" requires explicit package name at Exponent.pm line 16.
Global symbol "$path" requires explicit package name at Exponent.pm line 16.
Still i am getting following error..
Quote:
Originally Posted by
Salem
What possible motivation would there be for converting a perfectly usable (and short) perl script into a whole mass of C code?
If you're thinking it will be a lot faster, then it won't be. The code is so heavily bound to the file system that the same constraints which affect perl (which is itself written in C) will also affect any native C program.
> post 1 - I am new to Begineer in C programming
> post 6 - i am good in C programming but not in PERL
Mmm'kay, which is it?
> i am in urgent with this peace of code..can you give equavalent code for above PERL code in C programming
That might take the competent amongst us at least a day to write, debug and test and run to many hundreds of lines of code. It might take you with lots of help a couple of weeks to get there.
Oh, and the . in /.([chCH])$/ should be /\.([chCH])$/ if you really only want files which end in [chCH] and not just any old filename like say file.pch
Hai Salem i am getting stilll two errors? probably if you would provide C progfram means it will help me lot..thanks in advance
Global symbol "$path" requires explicit package name at Exponent.pm line 16.
Global symbol "$path" requires explicit package name at Exponent.pm line 16.
Hai mates can u give me that code?
Quote:
Originally Posted by
matsp
Yes, I wrote something to solve this problem - it doesn't do exactly what the perl-script does, but pretty close. [for example, it tries to create the header and source directory, and if there's already a file there by that name, it will not fail in the way the perl-script does - it will fail when it tries to create the new file in the directory].
I'm using the Windows file-finding API, but it shouldn't be terribly hard to replace it with the corresponding Unix version with fairly minor modifications.
Error handling in my code is there, but rudimentary.
It took about 175 lines of code.
--
Mats
Hai Mats,
Can you give that 175 line code..i will try to modify according to my requirement..i have tried lot..but still i am not able to meet project manager requirement..Thanks very much for your help