1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-17 10:46:01 +00:00
This commit is contained in:
MatteZ02
2020-03-03 22:30:50 +02:00
parent edfcc6f474
commit 30022c7634
11800 changed files with 1984416 additions and 1 deletions

33
node_modules/walkdir/test/comparison/find.js generated vendored Normal file
View File

@ -0,0 +1,33 @@
var spawn = require('child_process').spawn;
var find = spawn('find',[process.argv[2]||'./']);
var fs = require('fs');
var buf = '',count = 0;
handleBuf = function(data){
buf += data;
if(buf.length >= 1024) {
var lines = buf.split("\n");
buf = lines.pop();//last line my not be complete
count += lines.length;
process.stdout.write(lines.join("\n")+"\n");
}
};
find.stdout.on('data',function(data){
//buf += data.toString();
handleBuf(data)
//process.stdout.write(data.toString());
});
find.on('end',function(){
handleBuf("\n");
console.log('found '+count+' files');
console.log('ended');
});
find.stdin.end();

26
node_modules/walkdir/test/comparison/find.py generated vendored Normal file
View File

@ -0,0 +1,26 @@
import os
import sys
rootdir = sys.argv[1]
ino = {}
buf = []
for root, subFolders, files in os.walk(rootdir):
for filename in files:
filePath = os.path.join(root, filename)
try:
stat = os.lstat(filePath)
except OSError:
pass
inostr = stat.st_ino
if inostr not in ino:
ino[stat.st_ino] = 1
buf.append(filePath);
buf.append("\n");
if len(buf) >= 1024:
sys.stdout.write(''.join(buf))
buf = []
sys.stdout.write(''.join(buf));

15
node_modules/walkdir/test/comparison/finditsynctest.js generated vendored Normal file
View File

@ -0,0 +1,15 @@
var findit = require('findit');
var files = findit.findSync(process.argv[2]||'./');
var count = files.length;
console.log(files);
files = files.join("\n");
process.stdout.write(files+"\n");
console.log('found '+count+' files');

14
node_modules/walkdir/test/comparison/findittest.js generated vendored Normal file
View File

@ -0,0 +1,14 @@
var findit = require('findit');
var find = findit.find(process.argv[2]||'./');
var count = 0;
find.on('file',function(path,stat){
count++;
process.stdout.write(path+"\n");
});
find.on('end',function(){
console.log('found '+count+' regular files');
});

24
node_modules/walkdir/test/comparison/fstream.js generated vendored Normal file
View File

@ -0,0 +1,24 @@
var fstream = require('fstream');
var pipe = fstream.Reader(process.argv[2]||"../");
var count = 0,errorHandler;
pipe.on('entry',function fn(entry){
if(entry.type == "Directory"){
entry.on('entry',fn);
} else if(entry.type == "File") {
count++;
}
entry.on('error',errorHandler);
});
pipe.on('error',(errorHandler = function(error){
console.log('error event ',error);
}));
pipe.on('end',function(){
console.log('end! '+count);
});
//this is pretty slow

View File

@ -0,0 +1 @@
npm install

18
node_modules/walkdir/test/comparison/lsr.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
var lsr = require('ls-r');
lsr(process.argv[2]||'./',{maxDepth:500000,recursive:true},function(err,origPath,args){
if(err) {
console.log('eww an error! ',err);
return;
}
//console.log('hit');
var c = 0;
args.forEach(function(stat){
if(stat.isFile()){
console.log(stat.path);
c++;
}
});
console.log('found '+args.length+" regular files");
});

10
node_modules/walkdir/test/comparison/package.json generated vendored Normal file
View File

@ -0,0 +1,10 @@
{
"name":"recursedir-comparisons",
"version": "0.0.0",
"author": "Ryan Day <soldair@gmail.com>",
"devDependencies": {
"findit": "*",
"ls-r":"*",
"fstream":"*"
}
}