I am sure the code
wxURL Url("file:///c:/testfile.xml");
Url.GetInputStream();
used to work for me.
It now fails and logs the error message
wxLog: Error: can't open file 'file:///c:/testfile.xml' (error 123: the filename, directory name, or volume label syntax is incorrect.)
Stepping through the code it looks like the protcol part of the URI is not being stripped before the path is passed to wxFile::Open.
Is anyone else seeing this or am I doing something wrong?
Roger
wxURL.GetInputStream fails with file protocol Topic is solved
-
- In need of some credit
- Posts: 9
- Joined: Fri Oct 01, 2004 8:21 pm
Try this:
That may not solve the problem but I read somewhere that you should call ConvertToValid first.
Code: Select all
wxString path = "c:\\whatever.xml";
path = wxURL::ConvertToValidURI(path)
wxURL url(path);
wxInputStream *data;
data = url.GetInputStream();
-
- In need of some credit
- Posts: 9
- Joined: Fri Oct 01, 2004 8:21 pm
-
- In need of some credit
- Posts: 9
- Joined: Fri Oct 01, 2004 8:21 pm