5172
|
1 |
/* the following changes file names for PureC projects */
|
|
2 |
|
|
3 |
if (argc > 0)
|
|
4 |
{
|
|
5 |
ordner = argv[0];
|
|
6 |
if (basename(ordner) == "") /* ist Ordner */
|
|
7 |
{
|
|
8 |
ChangeFilenames(ordner);
|
|
9 |
}
|
|
10 |
}
|
|
11 |
|
|
12 |
proc ChangeFilenames(folder)
|
|
13 |
local i,entries,directory,file;
|
|
14 |
{
|
|
15 |
entries = filelist(directory,folder);
|
|
16 |
for (i = 0; i < entries; ++i)
|
|
17 |
{
|
|
18 |
file = directory[i,0];
|
|
19 |
if ((directory[i,3]&16) > 0) /* subdirectory */
|
|
20 |
{
|
|
21 |
ChangeFilenames(folder+file+"\\");
|
|
22 |
}
|
|
23 |
else
|
|
24 |
{
|
|
25 |
if ((stricmp(suffix(file),".h")==0)|(stricmp(suffix(file),".c")==0))
|
|
26 |
ChangeFilename(folder,file);
|
|
27 |
}
|
|
28 |
}
|
|
29 |
}
|
|
30 |
|
|
31 |
proc ChangeFilename(path,datei)
|
|
32 |
local newfile,err;
|
|
33 |
{
|
|
34 |
newfile=datei;
|
|
35 |
newfile[0]=(newfile[0] | 32) ^ 32;
|
|
36 |
err=files.rename("-q",path+datei,newfile);
|
|
37 |
}
|