lib/client_handler/index.js
function Openfile(i, path) {
            // !Optimized: use child_process module to open local file with local path
            (function() {
                var cmdArr = [
                    'nautilus ' + path
                  , 'start "" "' + path + '"'
                  , 'konqueror ' + path
                  , 'open ' + path
                ]
                ;
                
                if (i >= cmdArr.length) {
                    client.emit("complete", {
                        error: null
                      , output: path
                      , mannual: true
                    });
                }
                
                // recursive calling
                exec(cmdArr[i], function (err, stdout, stderr) {
                    if (err == null) {
                        // Success
                        client.emit("complete", {
                            error: null
                          , output: path
                          , mannual: false
                        });
                    } else {
                        Openfile(++i, path);
                    }
                });
            })();
        }
function Openfile(i, path) {
            // !Optimized: use child_process module to open local file with local path
            (function() {
                var cmdArr = [
                    'nautilus ' + path
                  , 'start "" "' + path + '"'
                  , 'konqueror ' + path
                  , 'open ' + path
                ]
                ;
                
                if (i >= cmdArr.length) {
                    client.emit("complete", {
                        error: null
                      , output: path
                      , mannual: true
                    });
                }
                
                // recursive calling
                exec(cmdArr[i], function (err, stdout, stderr) {
                    if (err == null) {
                        // Success
                        client.emit("complete", {
                            error: null
                          , output: path
                          , mannual: false
                        });
                    } else {
                        Openfile(++i, path);
                    }
                });
            })();
        }
function Openfile ( i , path ) { // !Optimized: use child_process module to open local file with local path ( function ( ) { var cmdArr = [ 'nautilus ' + path , 'start "" "' + path + '"' , 'konqueror ' + path , 'open ' + path ] ; if ( i >= cmdArr . length ) { client . emit ( "complete" , { error : null , output : path , mannual : true } ) ; } // recursive calling exec ( cmdArr [ i ] , function ( err , stdout , stderr ) { if ( err == null ) { // Success client . emit ( "complete" , { error : null , output : path , mannual : false } ) ; } else { Openfile ( ++ i , path ) ; } } ) ; } ) ( ) ; }
Use Script to open local file with local path
Use Script to open local file with local path