Registered Member
|
Hello everybody,
I want to create zip archive from all files in the current folder. Here is the code from my .desktop file:
It gives me an update.zip file as a result but... for example: If I have opened "/home/user/Desktop/WorkingFolder" in Dolphin where is located 1 file - "a.txt", and I run my script there it gives me the file compressed but the result zip file is placed in "/home/user" and inside the zip you can see that structure "/home/user/Desktop/WorkingFolder/a.txt". I would like to have "update.zip" file placed to "/home/user/Desktop/WorkingFolder" with "a.txt" file inside only. Any idea how to do it? |
Manager
|
for the file name stripped of the path:
per the man page: --junk-paths stores just the name of a saved file for all of what you want:
got this from the CompressIT.desktop file found in my ServiceMenus folder ps - not tested |
Registered Member
|
I will test and let you know
---------- It is already checked. It doesn't work. |
Administrator
|
To fix this you'll need to create a wrapper script which first changes into the desired directory (I recommend the "dirname" command to find this out) then invokes zip as desired.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
I tried to use this
but the result in log.txt is /home/user --- okay, I solved my problem by using absolut path:
... but it would be nice to know how to create an update.zip file by using the relative (current folder) path.
Last edited by urgo on Thu Apr 17, 2014 8:58 pm, edited 2 times in total.
|
Administrator
|
As far as I am aware, the Exec= line doesn't support bash/shell style statements. Hence why you need to place them all in a separate script stored elsewhere, and have the service menu execute that script instead.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]