libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / tools / unflatten / unflatten.cpp
blobf1e8d248d6dfa2272a58ae51a3338e5bdc8e6082
1 /*
2 * Copyright 2002, Marcus Overhagen. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
6 #include <File.h>
7 #include <Message.h>
8 #include <stdio.h>
10 int main(int argc, char *argv[])
12 BFile file;
13 BMessage msg;
14 if (argc != 2) {
15 fprintf(stderr, "You need to specify a filename on the command line.\n");
16 return 1;
18 if (B_OK != file.SetTo(argv[1], O_RDONLY)) {
19 fprintf(stderr, "File \"%s\" not found.\n", argv[1]);
20 return 1;
22 if (B_OK != msg.Unflatten(&file)) {
23 fprintf(stderr, "Unflatten failed.\n");
24 return 1;
26 msg.PrintToStream();
27 return 0;