[SOLVED] QFile and qrc files = bad file descriptor
General and Desktop
3
Posts
3
Posters
1.4k
Views
1
Watching
-
Hi everyone,
I have an issue with QFile when opening a file found in my qrc file.
What i'd like to do is to have a file descriptor on a file located in a qrc file.I successfully open in ReadOnly mode my file but when i ask for the handle I always get -1, is there anyway to get the file descriptor ? or it is simply impossible ?
Thanks :)
-
Hi,
@_tucnak_, It's not the same setup
A file retrieved from Qt's resources is not the same a file from your own filesystem.
However, there's a workaround for that, you can use QTemporaryFile. Open a temporary file, write the content of your resource in it and then use it for whatever you need.
Hope it helps