server/adapters/HttpAjax-adapter.js
function OpenFileCB (err, fd) {
        if (err) {
            response.setHeader('Content-Type','text/html');
            response.writeHead(404, err.toString("utf8"));
            response.write("Hoops:" +  err );
            response.end();
            return;
        }
        fs.fstat(fd, function(err,stats){
            // get file size and allocate buffer to read it
            var buffer = new Buffer (stats.size);
            fs.read (fd, buffer,0,buffer.length,0,ReadFileCB);
        });
    }
function OpenFileCB (err, fd) {
        if (err) {
            response.setHeader('Content-Type','text/html');
            response.writeHead(404, err.toString("utf8"));
            response.write("Hoops:" +  err );
            response.end();
            return;
        }
        fs.fstat(fd, function(err,stats){
            // get file size and allocate buffer to read it
            var buffer = new Buffer (stats.size);
            fs.read (fd, buffer,0,buffer.length,0,ReadFileCB);
        });
    }
function OpenFileCB ( err , fd ) { if ( err ) { response . setHeader ( 'Content-Type' , 'text/html' ) ; response . writeHead ( 404 , err . toString ( "utf8" ) ) ; response . write ( "Hoops:" + err ) ; response . end ( ) ; return ; } fs . fstat ( fd , function ( err , stats ) { // get file size and allocate buffer to read it var buffer = new Buffer ( stats . size ) ; fs . read ( fd , buffer , 0 , buffer . length , 0 , ReadFileCB ) ; } ) ; }
open file and check if its supported
open file and check if its supported