function checkIfFileExists(dirname, filename) {
	return new Promise((resolve, reject) => {
		cs.ls('screenshots/' + dirname, function(arr) {
			var length = arr.length;
			for(var i = 0; i < length; i++) {
				if(arr[i].name == filename) {
					resolve(true);
				}
			}
			resolve(false);
		});	
	});
}
/**
*	Checks if a file exists in a specific directory
* @param: dirname - directory name where we search the file
* @param: filename - the name of the file that we searh
* @return: true if the file exists in that directory, false otherwise
*/
Checks if a file exists in a specific directory
Checks if a file exists in a specific directory
function checkIfFileExists(dirname, filename) {
	return new Promise((resolve, reject) => {
		cs.ls('screenshots/' + dirname, function(arr) {
			var length = arr.length;
			for(var i = 0; i < length; i++) {
				if(arr[i].name == filename) {
					resolve(true);
				}
			}
			resolve(false);
		});	
	});
}
function checkIfFileExists ( dirname , filename ) { return new Promise ( ( resolve , reject ) => { cs . ls ( 'screenshots/' + dirname , function ( arr ) { var length = arr . length ; for ( var i = 0 ; i < length ; i ++ ) { if ( arr [ i ] . name == filename ) { resolve ( true ) ; } } resolve ( false ) ; } ) ; } ) ; }
Checks if a file exists in a specific directory
Checks if a file exists in a specific directory