diff options
| author | Root THC | 2026-02-24 12:42:47 +0000 |
|---|---|---|
| committer | Root THC | 2026-02-24 12:42:47 +0000 |
| commit | c9cbeced5b3f2bdd7407e29c0811e65954132540 (patch) | |
| tree | aefc355416b561111819de159ccbd86c3004cf88 /other/ecfs/repl.pl | |
| parent | 073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff) | |
initial
Diffstat (limited to 'other/ecfs/repl.pl')
| -rw-r--r-- | other/ecfs/repl.pl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/other/ecfs/repl.pl b/other/ecfs/repl.pl new file mode 100644 index 0000000..46e5b5b --- /dev/null +++ b/other/ecfs/repl.pl | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | # Written to transform ext2 functions and structs | ||
| 4 | # to ecfs. | ||
| 5 | # | ||
| 6 | |||
| 7 | my $f= shift; | ||
| 8 | open I, "<$f" or die "$!"; | ||
| 9 | open O, ">$f.new" or die "$!"; | ||
| 10 | |||
| 11 | while (<I>) { | ||
| 12 | s/ext2/ecfs/g; | ||
| 13 | s/EXT2/ECFS/g; | ||
| 14 | |||
| 15 | s/const// if (/ecfs_free_blocks/); | ||
| 16 | s/const// if (/ecfs_new_block/); | ||
| 17 | |||
| 18 | print O; | ||
| 19 | } | ||
| 20 | |||
| 21 | close O; | ||
| 22 | close I; | ||
| 23 | |||
| 24 | |||
| 25 | unlink $f; | ||
| 26 | rename "$f.new", $f; | ||
