Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1070004 Details for
Bug 1259746
Writer fails to open correct ODT file from WebDAV share
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
test code
giotest.cc (text/plain), 1.70 KB, created by
Stephan Bergmann
on 2015-09-03 17:11:10 UTC
(
hide
)
Description:
test code
Filename:
MIME Type:
Creator:
Stephan Bergmann
Created:
2015-09-03 17:11:10 UTC
Size:
1.70 KB
patch
obsolete
>#include <cassert> >#include <cstdlib> >#include <iostream> > >#include "gio/gio.h" > >void fail(char const * where, GError * error) { > assert(error != nullptr); > assert(error->message != nullptr); > std::cerr << "failure at " << where << ": \"" << error->message << "\"\n"; > std::exit(EXIT_FAILURE); >} > >int main(int argc, char ** argv) { > if (argc != 2) { > std::cerr << "need one argument\n"; > std::exit(EXIT_FAILURE); > } > GFile * f = g_file_new_for_commandline_arg(argv[1]); > if (f == nullptr) { > std::cerr << "g_file_new_for_uri failed\n"; > std::exit(EXIT_FAILURE); > } > GError * e = nullptr; > GFileInputStream * is = g_file_read(f, nullptr, &e); > if (is == nullptr) { > fail("g_file_read", e); > } > unsigned char buf1[4] {}; > gsize n1; > if (!g_input_stream_read_all(G_INPUT_STREAM(is), buf1, 4, &n1, nullptr, &e)) > { > fail("first g_input_stream_read_all", e); > } > std::cout > << n1 << ": " << unsigned(buf1[0]) << ' ' << unsigned(buf1[1]) << ' ' > << unsigned(buf1[2]) << ' ' << unsigned(buf1[3]) << '\n'; > std::cout > << "can seek: " << int(g_seekable_can_seek(G_SEEKABLE(is))) << '\n'; > if (!g_seekable_seek(G_SEEKABLE(is), 40569, G_SEEK_SET, nullptr, &e)) { > fail("g_seekable_seek", e); > } > std::cout << "tell: " << g_seekable_tell(G_SEEKABLE(is)) << '\n'; > unsigned char buf2[4] {}; > gsize n2; > if (!g_input_stream_read_all(G_INPUT_STREAM(is), buf2, 4, &n2, nullptr, &e)) > { > fail("second g_input_stream_read_all", e); > } > std::cout > << n2 << ": " << unsigned(buf2[0]) << ' ' << unsigned(buf2[1]) << ' ' > << unsigned(buf2[2]) << ' ' << unsigned(buf2[3]) << '\n'; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1259746
: 1070004