Hi, first of all I'm new on this. I need help because I don't know why allmost all KIO::NetAccess functions fails. I get segfault when I try to use them. The only one that seems to work is KIO::NetAccess::exists.
I'm trying to delete a local file with this code:
char* c = "file:/home/marcos/public_html/test2.txt";
KURL src = KURL( c );
if ( src.isValid() && KIO::NetAccess::exists(src, false, NULL) ) {
KIO::NetAccess::del(src, NULL);
cout << "file was deleted \n";
} else {
cout << "error, kurl is not valid or I can't access to the file \n";
}
I'm getting the segfault when running KIO::NetAccess::del(src, NULL); line, but KIO::NetAccess::exists(src, false, NULL) works fine. What I'm doing wrong?