Sure.
Well I made this:
#include <QtCore/QCoreApplication>
#include <QFile>
#include <QDebug>
int main(int argc, char *argv[])
{
QFile f
("C:\\Program Files (x86)\\TeamViewer\\Version6\\TeamViewer.exe");
if( !f.exists() )
{
// It does not exist
qDebug() << "The file does not exist.\n";
}
// It exists, open it
{
// It could not open
qDebug() << "Failed to open.";
return 0;
}
// It opened, now we need to close it
qDebug() << "Success";
int size = f.size();
qDebug() << "size: " << size;
char * buffer;
uint u = sizeof(f);
data.readBytes(buffer,u);
f.close();
return a.exec();
}
#include <QtCore/QCoreApplication>
#include <QFile>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QFile f("C:\\Program Files (x86)\\TeamViewer\\Version6\\TeamViewer.exe");
if( !f.exists() )
{
// It does not exist
qDebug() << "The file does not exist.\n";
}
// It exists, open it
if(!f.open(QIODevice::ReadOnly))
{
// It could not open
qDebug() << "Failed to open.";
return 0;
}
// It opened, now we need to close it
qDebug() << "Success";
int size = f.size();
qDebug() << "size: " << size;
QDataStream data(&f);
char * buffer;
uint u = sizeof(f);
data.readBytes(buffer,u);
f.close();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Then I thought that I may need to make a loop,in order to read a byte after byte..but still nothing.
Bookmarks