arudradey's picture
download
raw
802 Bytes
// Copyright 2011 The Emscripten Authors. All rights reserved.
// Emscripten is available under two separate licenses, the MIT license and the
// University of Illinois/NCSA Open Source License. Both these licenses can be
// found in the LICENSE file.
#include <string.h>
#include <stdio.h>
#include <emscripten.h>
int main() {
// this should not crash, but also should not show up anywhere if you are in a worker
printf("you should not see this text when in a worker!\n");
FILE *f = fopen("file.dat", "r");
char buffer[100];
buffer[0] = 0;
if (f) fread(buffer, 10, 1, f);
char buffer2[100];
int n = sprintf(buffer2, "if (typeof postMessage !== 'undefined') { postMessage('hello from worker, and :%s:') }", buffer);
printf("sprintf: %d\n", n);
emscripten_run_script(buffer2);
}

Xet Storage Details

Size:
802 Bytes
·
Xet hash:
f6defdc5106902b78b5d83e8fc1561f64635efbe9c7cd90750581ce982711864

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.