Re: open large file in qt?
The "HardDisk" is actually the root of the filesystem( "/" ). Therefore you cannot open it as a file.
What are you trying to do? Compress it, back it up?
Whatever you want, you must use 64 bytes for file sizes and offsets because the result will get pretty big.
Regards
Re: open large file in qt?
Thanks for reply.
Quote:
Originally Posted by
marcel
Whatever you want, you must use 64 bytes for file sizes and offsets because the result will get pretty big.
How can I use 64 bytes for file sizes?
open64 function is not there in the Mac.
Re: open large file in qt?
I think he means something like /dev/hda which is the harddisk itself.
First of all try checking if you have all required permissions to do that, for example if you can open the file as a regular user using something like hexedit or simmilar.
Re: open large file in qt?
Thanks for Reply.
Ya I just want to open file like /dev/rdisk0 from the qt application and I have all the permission for that but donot know how to open it on Mac.
Re: open large file in qt?
It works for me on Linux (I have to be root to do that though):
Code:
#include <QFile>
int main(){
if(!file.
open(QFile::ReadOnly)){ qDebug("FAILED");
} else {
qDebug("OPENED");
}
return 0;
}
Re: open large file in qt?
This function always return false on My MAC.
Re: open large file in qt?
What does Get Info in Finder has to say about /dev?
I mean, do you have any permissions at all?
Re: open large file in qt?
Quote:
Originally Posted by
marcel
What does Get Info in Finder has to say about /dev?
I mean, do you have any permissions at all?
Normal ist /Volumes
Code:
#if defined Q_WS_MAC
/* apple + K */
label_webdav->setText(tr("Mac OS: Mount Disk Webdav Root"));
webdav_root->addItem(disksetting);
/* webdav_root->addItem(listdiron);*/
if (dir.exists()) {
const QFileInfoList list = dir.entryInfoList();
for (int i = 0; i < list.size(); i++)
{
fi = list.at(i);
if (fi.isDir() && fi.fileName() != "." && fi.fileName() != "..") {
QString disker
= fi.
absoluteFilePath();
QString diskeree
= disker.
append("/");
webdav_root->addItem(diskeree);
}
}
}
webdav_root->setEditable(false);
#endif
Re: open large file in qt?
Thanks for Reply.
But Actually I want to open the HardDisk not to read Dir or File Actually I have to Read the Bytes from the HardDisk.
I have a function to do that but Actually It can not able to open the file. I have also used c function open("/dev/rdisk0",O_RDONLY) but it also not able to open the Drives.
It is showing that it has read write permission when I see from Getinfo in finder.
Actually I have tried on other system but it doesnot work.
It is working when I open a removable media but not in case of Hard disk.
Re: open large file in qt?
What does ls -l /dev/rdisk0 return?
Re: open large file in qt?
Hey guys I got it.
Actually I am login as admin but it have some file system permission to root user.
So I just enabled user root and now it is running correctly.
Guys Thanks for reply.