summaryrefslogtreecommitdiffstats
path: root/perl-install/resize_fat/directory.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-02-09 11:40:32 +0000
committerFrancois Pons <fpons@mandriva.com>2000-02-09 11:40:32 +0000
commit77d16a3330cab8b9c86667220114542958e7a348 (patch)
treee7fa44df3f8315f3e9cbad50b87bfc8250aeb6d4 /perl-install/resize_fat/directory.pm
parent4ce69234e573c58002f3d1a9f361489410e883b2 (diff)
downloaddrakx-77d16a3330cab8b9c86667220114542958e7a348.tar
drakx-77d16a3330cab8b9c86667220114542958e7a348.tar.gz
drakx-77d16a3330cab8b9c86667220114542958e7a348.tar.bz2
drakx-77d16a3330cab8b9c86667220114542958e7a348.tar.xz
drakx-77d16a3330cab8b9c86667220114542958e7a348.zip
*** empty log message ***
Diffstat (limited to 'perl-install/resize_fat/directory.pm')
-rw-r--r--perl-install/resize_fat/directory.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/perl-install/resize_fat/directory.pm b/perl-install/resize_fat/directory.pm
index cdce4be88..1bc1014c6 100644
--- a/perl-install/resize_fat/directory.pm
+++ b/perl-install/resize_fat/directory.pm
@@ -32,8 +32,8 @@ sub entry_size { $psizeof_format }
#- call `f' for each entry of the directory
#- if f return true, then modification in the entry are taken back
-sub traverse($$) {
- my ($directory, $f) = @_;
+sub traverse($$$) {
+ my ($directory, $curr_dir_name, $f) = @_;
for (my $i = 0;; $i++) {
my $raw = \substr($directory, $i * $psizeof_format, $psizeof_format);
@@ -43,7 +43,7 @@ sub traverse($$) {
my $entry; @{$entry}{@fields} = unpack $format, $$raw;
- &$f($entry)
+ &$f($curr_dir_name, $entry)
and $$raw = pack $format, @{$entry}{@fields};
}
$directory;
@@ -53,12 +53,12 @@ sub traverse_all($$) {
my ($fs, $f) = @_;
my $traverse_all; $traverse_all = sub {
- my ($entry) = @_;
+ my ($curr_dir_name, $entry) = @_;
- &$f($entry);
+ &$f($curr_dir_name, $entry);
resize_fat::dir_entry::is_directory($entry)
- and traverse(resize_fat::io::read_file($fs, resize_fat::dir_entry::get_cluster($entry)), $traverse_all);
+ and traverse(resize_fat::io::read_file($fs, resize_fat::dir_entry::get_cluster($entry)), "$curr_dir_name/$entry->{name}", $traverse_all);
undef; #- no need to write back (cf traverse)
};
@@ -66,7 +66,7 @@ sub traverse_all($$) {
my $directory = $resize_fat::isFAT32 ?
resize_fat::io::read_file($fs, $fs->{fat32_root_dir_cluster}) :
resize_fat::io::read($fs, $fs->{root_dir_offset}, $fs->{root_dir_size});
- traverse($directory, $traverse_all);
+ traverse($directory, "", $traverse_all);
undef $traverse_all; #- circular reference is no good for perl's poor GC :(
}
@@ -75,5 +75,5 @@ sub traverse_all($$) {
#- directory entry
sub remap($$) {
my ($fs, $directory) = @_;
- traverse($directory, \&resize_fat::dir_entry::remap);
+ traverse($directory, "", \&resize_fat::dir_entry::remap);
}