This forum has been archived. All content is frozen. Please use KDE Discuss instead.

About the compress tool in Dolphin

Tags: None
(comma "," separated)
User avatar
nishengyue
Registered Member
Posts
7
Karma
0
OS

About the compress tool in Dolphin

Sun Oct 21, 2012 12:23 pm
The Dolphin have the ability to compress /uncompress file, and I find that if I need to compress a big file ,to several packages, I can't do it in Dolphin, in fact I don't know how to do it in linux, so I think the compress tool should provide some configure to user, so they can compress in several packages.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Have you tried using Ark?
Can you please provide more details on the precise error messages or problems you are facing compressing large files?

Native linux file systems are more than capable of storing very large files so this should not be a problem.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
nishengyue
Registered Member
Posts
7
Karma
0
OS
For example, I need to compress the file 'webOS-V1.0.pdf' file to .rar format, and need every generated .rar file should no more than 500kb, in the Ark ,there is no configure to let me do like this.

Image
User avatar
google01103
Manager
Posts
6668
Karma
25
you can do this with the rar command using the volume size switch: v<size>[k,b] Create volumes with size=<size>*1000 [*1024, *1]

so for your example it would be
Code: Select all
rar a -v500k webOS-V1.0.rar webOS-V1.0.pdf


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
nishengyue
Registered Member
Posts
7
Karma
0
OS
Yes, maybe I can try to read the code to design a UI interface, thanks .
User avatar
google01103
Manager
Posts
6668
Karma
25
you could do this with a service menu

this is basically copied verbatim and adjusted from something that's on my system and neither tested nor guaranteed

service menu (placed in ~/.kde/share/kde4/services/ServiceMenus:
Code: Select all
[Desktop Action compress_RAR-500k-chunks]
Exec=~/bin/compress_RAR-500k-chunks.sh %U
Icon=application-x-archive
Name=Compress to rar in 500k chunks


compression script (placed in ~/bin/compress_RAR-500k-chunks.sh )
Code: Select all
#!/bin/bash

dir=$(dirname "$1")

cd "$dir"
files=""
y="0"

for i in "$@";do
file=$(basename "$i")
files="$files"" \"""$file""\""
y=$((y+1))
done

if [ $y -gt 1 ];then
name=$(archname_dialog.sh "$getname")
  if [ "$name" == "" ];then
  compress_cancel_dialog.sh
  exit
  fi
else
name=$(basename "$1")
fi

archname="$name"".rar"
exec="rar a -v500k -o+ ""\"$archname\"""$files"

overw="0"

if ( [ -d "$archname" ] || [ -f "$archname" ] ); then
echo "file/folder exists"
overw=$(overwrite_compress_dialog.sh "$ow")
fi
echo $overw

if [ "$overw" == "0" ];then
echo "$exec" > .comparchive.sh && chmod a=r+w+x .comparchive.sh
sh .comparchive.sh && rm .comparchive.sh
compress_dialog.sh
else
compress_cancel_dialog.sh
fi


OpenSuse Leap 42.1 x64, Plasma 5.x



Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]