Registered Member
|
I am trying to read some file's contents from within an Amarok script. I included qt.core bindings.
var myFile = new QFile(path); Amarok.alert(myFile.size()); returns the correct size of the file stored at path. However, myFile.exists(path) always returns false, and so does myFile.open(1) (I used the 1 for QIODevice::ReadOnly, since I do not know how to access this constant from JavaScript) Does someone have a hint on how I can open and read binary files in an Amarok Script? Tanks fpe |
Administrator
|
Does "path" contain a path to an actual file on disk?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Yes.
The code did work in C++, now I'm trying to port it to Amarok Script. |
Registered Member
|
I finally found out how to correctly open a file for reading:
myFile.open(new QIODevice.OpenMode(QIODevice.ReadOnly)); Now it's working |
Registered users: Bing [Bot], gfielding, Google [Bot], markhm, Sogou [Bot], Yahoo [Bot]