summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake/resize_ntfs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-31 00:50:56 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-31 00:50:56 +0000
commit2dcc6852ee2dd49f88999bb6141df1d56f8bbb3f (patch)
treec61529cf3710c37e6f2d3b68b740b40fd7f5109f /perl-install/diskdrake/resize_ntfs.pm
parentdb0dc40ad297041e36bb39ec5993db30b94cbf27 (diff)
downloaddrakx-2dcc6852ee2dd49f88999bb6141df1d56f8bbb3f.tar
drakx-2dcc6852ee2dd49f88999bb6141df1d56f8bbb3f.tar.gz
drakx-2dcc6852ee2dd49f88999bb6141df1d56f8bbb3f.tar.bz2
drakx-2dcc6852ee2dd49f88999bb6141df1d56f8bbb3f.tar.xz
drakx-2dcc6852ee2dd49f88999bb6141df1d56f8bbb3f.zip
create diskdrake::resize_ntfs to factorize code
Diffstat (limited to 'perl-install/diskdrake/resize_ntfs.pm')
-rw-r--r--perl-install/diskdrake/resize_ntfs.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/perl-install/diskdrake/resize_ntfs.pm b/perl-install/diskdrake/resize_ntfs.pm
new file mode 100644
index 000000000..30e860f6f
--- /dev/null
+++ b/perl-install/diskdrake/resize_ntfs.pm
@@ -0,0 +1,26 @@
+package diskdrake::resize_ntfs;
+
+use diagnostics;
+use strict;
+
+use run_program;
+use common;
+
+
+sub new {
+ my ($type, $_device, $dev) = @_;
+ bless { dev => $dev }, $type;
+}
+
+sub min_size {
+ my ($o) = @_;
+ my $r = run_program::get_stdout('ntfsresize', '-f', '-i', $o->{dev});
+ $r =~ /minimal size: (\d+) KiB/ && $1 * 2
+}
+
+sub resize {
+ my ($o, $size) = @_;
+ run_program::run_or_die('ntfsresize', '-ff', '-s' . int($size / 2) . 'ki', $o->{dev});
+}
+
+1;