summaryrefslogtreecommitdiffstats
path: root/perl-install/resize_fat/dir_entry.pm
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>1999-09-29 14:13:47 +0000
committerMystery Man <unknown@mandriva.org>1999-09-29 14:13:47 +0000
commit229435ccf04db72401bb5df7d3b015565952fcc5 (patch)
tree16ffcdb570219012938b771f1b9ab064114d2b5f /perl-install/resize_fat/dir_entry.pm
parentec5cc80aff948eceee5b322bc19cf3e4e65a7c3a (diff)
downloaddrakx-backup-do-not-use-229435ccf04db72401bb5df7d3b015565952fcc5.tar
drakx-backup-do-not-use-229435ccf04db72401bb5df7d3b015565952fcc5.tar.gz
drakx-backup-do-not-use-229435ccf04db72401bb5df7d3b015565952fcc5.tar.bz2
drakx-backup-do-not-use-229435ccf04db72401bb5df7d3b015565952fcc5.tar.xz
drakx-backup-do-not-use-229435ccf04db72401bb5df7d3b015565952fcc5.zip
This commit was manufactured by cvs2svn to create tag 'V1_0'.V1_0
Diffstat (limited to 'perl-install/resize_fat/dir_entry.pm')
-rw-r--r--perl-install/resize_fat/dir_entry.pm72
1 files changed, 0 insertions, 72 deletions
diff --git a/perl-install/resize_fat/dir_entry.pm b/perl-install/resize_fat/dir_entry.pm
deleted file mode 100644
index cfee23dae..000000000
--- a/perl-install/resize_fat/dir_entry.pm
+++ /dev/null
@@ -1,72 +0,0 @@
-package resize_fat::dir_entry;
-
-use diagnostics;
-use strict;
-
-
-my $DELETED_FLAG = 0xe5;
-my $VOLUME_LABEL_ATTR = 0x08;
-my $VFAT_ATTR = 0x0f;
-my $DIRECTORY_ATTR = 0x10;
-
-1;
-
-sub get_cluster($) {
- my ($entry) = @_;
- $entry->{first_cluster} + ($resize_fat::isFAT32 ? $entry->{first_cluster_high} * 65536 : 0);
-}
-sub set_cluster($$) {
- my ($entry, $val) = @_;
- $entry->{first_cluster} = $val & (1 << 16) - 1;
- $entry->{first_cluster_high} = $val >> 16 if $resize_fat::isFAT32;
-}
-
-sub is_directory_raw($) {
- my ($entry) = @_;
- !is_special_entry($entry) && $entry->{attributes} & $DIRECTORY_ATTR;
-}
-
-sub is_directory($) {
- my ($entry) = @_;
- is_directory_raw($entry) && $entry->{name} !~ /^\.\.? /;
-}
-
-sub is_volume($) {
- my ($entry) = @_;
- !is_special_entry($entry) && $entry->{attributes} & $VOLUME_LABEL_ATTR;
-}
-
-sub is_file($) {
- my ($entry) = @_;
- !is_special_entry($entry) && !is_directory($entry) && !is_volume($entry) && $entry->{length};
-}
-
-
-sub is_special_entry($) {
- my ($entry) = @_;
- my ($c) = unpack "C", $entry->{name};
-
- #- skip empty slots, deleted files, and 0xF6?? (taken from kernel)
- $c == 0 || $c == $DELETED_FLAG || $c == 0xF6 and return 1;
-
- $entry->{attributes} == $VFAT_ATTR and return 1;
- 0;
-}
-
-
-#- return true if entry has been modified
-sub remap {
- my ($fat_remap, $entry) = @_;
-
- is_special_entry($entry) and return;
-
- my $cluster = get_cluster($entry);
- my $new_cluster = $fat_remap->[$cluster];
-
- #-print "remapping cluster ", get_first_cluster($fs, $entry), " to $new_cluster";
-
- $new_cluster == $cluster and return; #- no need to modify
-
- set_cluster($entry, $new_cluster);
- 1;
-}