Hi,
Do you know of any way for editing files in total commander with kate (a linux program) instead of notepad.exe?.
Thanks,
Daniel
The following comments are owned by whoever posted them. We are not responsible for them in any way.
Back to Threads Reply to Thread
Hi,
Do you know of any way for editing files in total commander with kate (a linux program) instead of notepad.exe?.
Thanks,
Daniel
I don't see how that would be possible.
Maybe if you make a alias ( shortcut) to Kate and then choose the to alias as the default editor in T C
I've managed to open a file using kate from total commander. Here is how:
int
main(int argc, char *argv[])
{
char buff[512], command[512], c;
int i, j=0, write=0;
for (i=0; i<strlen(argv[1]); i++)
{
write = 1; // controls if the character will be written to buff or not
c = argv[1][i]; // get the next character
switch (i)
{
case 0: // first character is always the drive leter.
switch (c)
{
case 'y':
case 'Y': // this is by default assigned to the user's home
c = '~';
break;
case 'z':
case 'Z': // this is by default assigned to the system's root folder
write = 0;
break;
}
break;
case 1: // this is always ':'
write = 0;
break;
default:
switch(c)
{
case '\\': // convert backslash in slash
c = '/';
break;
}
}
if (write) // store the converted char in the temporary buffer
{
buff[j] = c;
j++;
}
}
buff[j] = 0; // end the temporary string nicely
snprintf(command, 512, "kate %s", buff); // this is the linux command to run. It can be anything
return system(command);
}
2. Copy the resulting binary to /usr/bin (or whatever other location you want) and give execute permissions to your user.
3. Open total commander
4. Go to Configuration -> Options -> Operation -> Edit/View
5. Change the value for the "Editor for F4" to "Z:\usr\bin\yourexec.exe" (or the location you have chosen at step 2.)
6. done
This method will work for any file with the name smaller than 8 chars. For files with longer names total commander truncates the name and changes it to upper case. Maybe somebody has an idea of how to overcome this limitation.
Best regards,
Daniel
CrossOver Forums: the place to discuss running Windows applications on Mac and Linux