I created a program to be invoked as a default for certain file types. I “Open [any file] with…” it - the file “test.txt” is created, but no I/O with my program is possible. In order to be able to communicate with my program I created an “Application in Terminal” launcher (shortcut, label, desktop icon) for my executable. Now I “Open [any file] with…” it - no file “test.txt” is created. Why?
#include <stdio.h>
char pcPW[1000];
FILE *fp;
int main()
{
printf("Start.\n");
fp = fopen("/home/kkk/build-ert-Desktop-Debug/test.txt", "w+");
fprintf(fp, "Start.\n");
fclose(fp);
scanf("%s",pcPW);
printf("pcPW:%s\n",pcPW);
fp = fopen("/home/kkk/build-ert-Desktop-Debug/test.txt", "a+");
fprintf(fp, "pcPW: \n%s\n", pcPW);
fclose(fp);
return 0;
}
Screenshots: http://www.filedropper.com/downloads_87