diogo.urb
Newbie

Posts: 42
|
 |
« on: May 21, 2010, 09:08:16 PM » |
|
Hi everyone,
I realized that everytime I tried to open a file with a space on the name I had problems, except when I openned it from inside cycas running.
So once more I saw that the problem was on the scripts that start cycas. First the AltGr now spaces.
The program /opt/cycas39/cycas.real only accepts one argument which is the filepath to be opened.
Now doing a lot of testing I saw that from the begging when we call the sh interpreter, it modifies the arguments on $@ and takes of the from the escapes. For instance:
If I call a program called teste.sh with the argument /home/diogo/Teste 1.ext . The sh interpreter will parse as argument for the script /home/diogo/Teste 1.ext .
For many programs this is not a problem. But for cycas it is. Cycas need the filename to be parsed with the backslash on the escapes. So we need to modify the script so it readd the to the escapes before calling for cycas.real
So here it is: on file /usr/local/bin/cycas39 we need to modify completly the file to the following
#!/bin/bash arg=$@ filepath_slash=`echo $arg|sed -e ´s/ /\ /g´`
# Enter to the correct directory cd /opt/cycas39 # Open file - eval is necessary for correct function, otherwise it won´t work eval ./cycas.real $filepath_slash > /dev/null 2>&1 &
And for the file on /usr/local/bin/cycas39_verbose :
#!/bin/bash arg=$@ echo ´Trying to open file: ´ ${arg##*/} echo ´File location: ´ ${arg%/*}
filepath_slash=`echo $arg|sed -e ´s/ /\ /g´`
# Enter to the correct directory cd /opt/cycas39 # Open file - eval is necessary for correct function, otherwise it won´t work eval ./cycas.real $filepath_slash &
Here on the verbose mode I added another modification, where it will print you the filename and path before starting the program.
Now this modification already changes the file since it is not necessary to export the LANG variable neither it is necessary to do a xmodmap, so we can have cycas running. This modification also only concerns the spaces on the filepaths. So if you have a @ inside the filepath you will still have problems. But as far as I consider I don´t think other escape characters other than will be put on the file´s paths.
Now, other flaw I observed concerns lack of mime types installed together with the cycas package. So I´m working on it, including a icon for the mime-type, so this way .cyc and .cyc.bak files would get easily find on directories.
The final observation is... I now cycas 4 is being worked on but its release is going to be more 6 months from now or latter, so until that occurs, and even when it gets released, it doesn´t mean that everyone that acquired the cycas3 license will upgrade to 4. So I´m here posting this modifications to improve the cycas experience on the linux desktop
PS.: copy and paste this lines, because there are and on the lines that the font used on the forums doesn´t allow to see correctly
|