added support for reading of volumelabel
* src/reiser4.cc src/reiserfs.cc: added support for reading of volumelabel
This commit is contained in:
parent
d106a71822
commit
7a8aabe3fd
|
@ -1,3 +1,8 @@
|
||||||
|
2006-09-24 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||||
|
|
||||||
|
* src/reiser4.cc
|
||||||
|
src/reiserfs.cc: added support for reading of volumelabel
|
||||||
|
|
||||||
2006-09-23 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
2006-09-23 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||||
|
|
||||||
* src/ntfs.cc: added support for reading of volumelabel
|
* src/ntfs.cc: added support for reading of volumelabel
|
||||||
|
|
|
@ -27,7 +27,10 @@ FS reiser4::get_filesystem_support()
|
||||||
fs .filesystem = GParted::FS_REISER4 ;
|
fs .filesystem = GParted::FS_REISER4 ;
|
||||||
|
|
||||||
if ( ! Glib::find_program_in_path( "debugfs.reiser4" ) .empty() )
|
if ( ! Glib::find_program_in_path( "debugfs.reiser4" ) .empty() )
|
||||||
|
{
|
||||||
fs .read = GParted::FS::EXTERNAL ;
|
fs .read = GParted::FS::EXTERNAL ;
|
||||||
|
fs .get_label = FS::EXTERNAL ;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! Glib::find_program_in_path( "mkfs.reiser4" ) .empty() )
|
if ( ! Glib::find_program_in_path( "mkfs.reiser4" ) .empty() )
|
||||||
fs .create = GParted::FS::EXTERNAL ;
|
fs .create = GParted::FS::EXTERNAL ;
|
||||||
|
@ -79,6 +82,22 @@ void reiser4::set_used_sectors( Partition & partition )
|
||||||
|
|
||||||
void reiser4::get_label( Partition & partition )
|
void reiser4::get_label( Partition & partition )
|
||||||
{
|
{
|
||||||
|
if ( ! Utils::execute_command( "debugfs.reiser4 " + partition .get_path(), output, error, true ) )
|
||||||
|
{
|
||||||
|
char buf[512] ;
|
||||||
|
index = output .find( "label" ) ;
|
||||||
|
|
||||||
|
if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "label: %512s", buf ) == 1 )
|
||||||
|
partition .label = buf ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( ! output .empty() )
|
||||||
|
partition .messages .push_back( output ) ;
|
||||||
|
|
||||||
|
if ( ! error .empty() )
|
||||||
|
partition .messages .push_back( error ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool reiser4::create( const Partition & new_partition, OperationDetail & operationdetail )
|
bool reiser4::create( const Partition & new_partition, OperationDetail & operationdetail )
|
||||||
|
|
|
@ -27,7 +27,10 @@ FS reiserfs::get_filesystem_support()
|
||||||
fs .filesystem = GParted::FS_REISERFS ;
|
fs .filesystem = GParted::FS_REISERFS ;
|
||||||
|
|
||||||
if ( ! Glib::find_program_in_path( "debugreiserfs" ) .empty() )
|
if ( ! Glib::find_program_in_path( "debugreiserfs" ) .empty() )
|
||||||
|
{
|
||||||
fs .read = GParted::FS::EXTERNAL ;
|
fs .read = GParted::FS::EXTERNAL ;
|
||||||
|
fs .get_label = FS::EXTERNAL ;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! Glib::find_program_in_path( "mkreiserfs" ) .empty() )
|
if ( ! Glib::find_program_in_path( "mkreiserfs" ) .empty() )
|
||||||
fs .create = GParted::FS::EXTERNAL ;
|
fs .create = GParted::FS::EXTERNAL ;
|
||||||
|
@ -84,6 +87,22 @@ void reiserfs::set_used_sectors( Partition & partition )
|
||||||
|
|
||||||
void reiserfs::get_label( Partition & partition )
|
void reiserfs::get_label( Partition & partition )
|
||||||
{
|
{
|
||||||
|
if ( ! Utils::execute_command( "debugreiserfs " + partition .get_path(), output, error, true ) )
|
||||||
|
{
|
||||||
|
char buf[512] ;
|
||||||
|
index = output .find( "LABEL" ) ;
|
||||||
|
|
||||||
|
if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "LABEL: %512s", buf ) == 1 )
|
||||||
|
partition .label = buf ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( ! output .empty() )
|
||||||
|
partition .messages .push_back( output ) ;
|
||||||
|
|
||||||
|
if ( ! error .empty() )
|
||||||
|
partition .messages .push_back( error ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool reiserfs::create( const Partition & new_partition, OperationDetail & operationdetail )
|
bool reiserfs::create( const Partition & new_partition, OperationDetail & operationdetail )
|
||||||
|
|
Loading…
Reference in New Issue