/*
#$ -u ifbuser
#$ -wd /home/ifbuser/cacheDir
#$ -N dummy_name_long
#$ -o dummy.out
#$ -e dummy.err
488560
function(id, profileKey, workDir) {
    console.log("Generating preprocessor string content");

    if( !profiles.hasOwnProperty("definitions") ) {
         throw("\"profiles\" dictionary is badly formed, no \"definitions\" key");
    }
    if ( !profiles.definitions.hasOwnProperty(profileKey) ) {
        throw("\"" + profileKey + "\" is not a registred SGE profile");
    }
    var string = _preprocessorDump(id, workDir, profiles.definitions[profileKey]);
    //string += _preprocessorDump(id, profiles.definitions[profileKey]);
    console.log(string);

    return string;
}
626501
private void handlePrefixes(
      String bucketName, List<String> prefixes, List<GoogleCloudStorageItemInfo> objectInfos) {
    if (storageOptions.isInferImplicitDirectoriesEnabled()) {
      for (String prefix : prefixes) {
        objectInfos.add(
            GoogleCloudStorageItemInfo.createInferredDirectory(
                new StorageResourceId(bucketName, prefix)));
      }
    } else {
      logger.atInfo().log(
          "Inferred directories are disabled, giving up on retrieving missing directories: %s",
          prefixes);
    }
  }
281423
function initTmpDir (dirname, cb) {
  var dir = path.join(os.tmpDir(), dirname);

  rmrf(dir, function (err) {
    if (err) return cb(err);
    mkdir(dir, function (err) {
      if (err) return cb(err);
      cb(null, dir);
    });
  });
}
1332201
function(/**string*/ outDir, /**string*/ fileName, /**string*/ content) {
		var out = new Packages.java.io.PrintWriter(
			new Packages.java.io.OutputStreamWriter(
				new Packages.java.io.FileOutputStream(outDir+SYS.slash+fileName),
				IO.encoding
			)
		);
		out.write(content);
		out.flush();
		out.close();
	}
331448
function( wcDir, options, callback ) {
	if ( typeof options === "function" ) {
		callback = options;
		options = null;
	}
	options = options || {};
	if ( !Array.isArray( wcDir ) ) {
		wcDir = [wcDir];
	}
	var args = [ '-n' ];
	if ( options.lastChangeRevision ) {
		args.push( '-c' );
	}
	execSvnVersion( wcDir.concat( args ), options, function( err, data ) {
		var result;
		if ( !err ) {
			var match = data.match( /(\d+):?(\d*)(\w*)/ );
			if ( match ) {
				result = {};
				result.low = parseInt( match[1] );
				if ( match[2].length > 0 ) {
					result.high = parseInt( match[2] );
				} else {
					result.high = result.low;
				}
				result.flags = match[3];
				if ( result.flags.length > 0 ) {
					result.modified = result.flags.indexOf( 'M' ) >= 0;
					result.partial = result.flags.indexOf( 'P' ) >= 0;
					result.switched = result.flags.indexOf( 'S' ) >= 0;
				}
			} else {
				err = data;
			}
		}
		callback( err, result );
	} );
}
462857
private Optional<LoadInfo> maybeGetLoadInfo(DataDirectoryKey dataDirKey) {
        Optional<DataDirEntry> dirEntry = optHeader
                .maybeGetDataDirEntry(dataDirKey);
        if (dirEntry.isPresent()) {
            long virtualAddress = dirEntry.get().getVirtualAddress();
            Optional<Long> maybeOffset = maybeGetFileOffsetFor(dataDirKey);
            if (!maybeOffset.isPresent()) {
                logger.info("unable to get file offset for " + dataDirKey);
            }
            long offset = maybeOffset.or(-1L);
            return Optional.of(new LoadInfo(offset, virtualAddress,
                    getMemoryMappedPE(), data, this));

        }
        return Optional.absent();
    }
407312
def chdir(dirname)
      if dirname == ".."
        begin
          voidcmd("CDUP")
          return
        rescue FTPPermError => e
          if e.message[0, 3] != "500"
            raise e
          end
        end
      end
      cmd = "CWD " + dirname
      voidcmd(cmd)
    end
538026
@Override
    public int decode ( byte[] buffer, int bufferIndex, int len ) throws SMBProtocolDecodingException {
        int start = bufferIndex;
        this.allocationSize = SMBUtil.readInt8(buffer, bufferIndex);
        bufferIndex += 8;
        this.endOfFile = SMBUtil.readInt8(buffer, bufferIndex);
        bufferIndex += 8;
        this.numberOfLinks = SMBUtil.readInt4(buffer, bufferIndex);
        bufferIndex += 4;
        this.deletePending = ( buffer[ bufferIndex++ ] & 0xFF ) > 0;
        this.directory = ( buffer[ bufferIndex++ ] & 0xFF ) > 0;
        return bufferIndex - start;
    }
131629
function(files, target, fm, isDir) {
			var dfrd = $.Deferred(),
				names, renames = [], hashes = {}, chkFiles = [],
				cancel = function() {
					var i = files.length;
					while (--i > -1) {
						files[i]._remove = true;
					}
				},
				resolve = function() {
					dfrd.resolve(renames, hashes);
				},
				check = function() {
					var existed = [], exists = [], i, c,
						pathStr = target !== fm.cwd().hash? fm.path(target, true) + fm.option('separator', target) : '',
						confirm = function(ndx) {
							var last = ndx == exists.length-1,
								opts = {
									cssClass : 'elfinder-confirm-upload',
									title  : fm.i18n('cmdupload'),
									text   : ['errExists', pathStr + exists[ndx].name, 'confirmRepl'], 
									all    : !last,
									accept : {
										label    : 'btnYes',
										callback : function(all) {
											!last && !all
												? confirm(++ndx)
												: resolve();
										}
									},
									reject : {
										label    : 'btnNo',
										callback : function(all) {
											var i;
			
											if (all) {
												i = exists.length;
												while (ndx < i--) {
													files[exists[i].i]._remove = true;
												}
											} else {
												files[exists[ndx].i]._remove = true;
											}
			
											!last && !all
												? confirm(++ndx)
												: resolve();
										}
									},
									cancel : {
										label    : 'btnCancel',
										callback : function() {
											cancel();
											resolve();
										}
									},
									buttons : [
										{
											label : 'btnBackup',
											cssClass : 'elfinder-confirm-btn-backup',
											callback : function(all) {
												var i;
												if (all) {
													i = exists.length;
													while (ndx < i--) {
														renames.push(exists[i].name);
													}
												} else {
													renames.push(exists[ndx].name);
												}
												!last && !all
													? confirm(++ndx)
													: resolve();
											}
										}
									]
								};
							
							if (!isDir) {
								opts.buttons.push({
									label : 'btnRename' + (last? '' : 'All'),
									cssClass : 'elfinder-confirm-btn-rename',
									callback : function() {
										renames = null;
										resolve();
									}
								});
							}
							if (fm.iframeCnt > 0) {
								delete opts.reject;
							}
							fm.confirm(opts);
						};
					
					if (! fm.file(target).read) {
						// for dropbox type
						resolve();
						return;
					}
					
					names = $.map(files, function(file, i) { return file.name && (!fm.UA.iOS || file.name !== 'image.jpg')? {i: i, name: file.name} : null ;});
					
					fm.request({
						data : {cmd : 'ls', target : target, intersect : $.map(names, function(item) { return item.name;})},
						notify : {type : 'preupload', cnt : 1, hideCnt : true},
						preventDefault : true
					})
					.done(function(data) {
						var existedArr, cwdItems;
						if (data) {
							if (data.error) {
								cancel();
							} else {
								if (fm.options.overwriteUploadConfirm && fm.option('uploadOverwrite', target)) {
									if (data.list) {
										if (Array.isArray(data.list)) {
											existed = data.list || [];
										} else {
											existedArr = [];
											existed = $.map(data.list, function(n) {
												if (typeof n === 'string') {
													return n;
												} else {
													// support to >=2.1.11 plugin Normalizer, Sanitizer
													existedArr = existedArr.concat(n);
													return false;
												}
											});
											if (existedArr.length) {
												existed = existed.concat(existedArr);
											}
											hashes = data.list;
										}
										exists = $.grep(names, function(name){
											return $.inArray(name.name, existed) !== -1 ? true : false ;
										});
										if (exists.length && existed.length && target == fm.cwd().hash) {
											cwdItems = $.map(fm.files(target), function(file) { return file.name; } );
											if ($.grep(existed, function(n) { 
												return $.inArray(n, cwdItems) === -1? true : false;
											}).length){
												fm.sync();
											}
										}
									}
								}
							}
						}
						if (exists.length > 0) {
							confirm(0);
						} else {
							resolve();
						}
					})
					.fail(function(error) {
						cancel();
						resolve();
						error && fm.error(error);
					});
				};
			if (fm.api >= 2.1 && typeof files[0] == 'object') {
				check();
			} else {
				resolve();
			}
			return dfrd;
		}
532208
function removeExtensionDir(done) {
            if (!self.dir) return done(null);

            rimraf(self.dir, done);
        }
765223
function(callback) {
      fs.readdir(args['<directory>'], function(err, files) {
        // error here means it does not exist, which is good.
        if (err || args['--force']) {
          return callback(null, args['<directory>']);
        }
        if (files.length > 0) {
          return callback(new Error(format('destination '
            + 'directory %s is not empty.', path.resolve(args['<directory>']))));
        }
        return callback(null, args['<directory>']);
      });
    }
1257061
public Page<Blob> listBlobsWithDirectoryAndPrefix(String bucketName, String directory) {
    // [START listBlobsWithDirectoryAndPrefix]
    Page<Blob> blobs =
        storage.list(
            bucketName, BlobListOption.currentDirectory(), BlobListOption.prefix(directory));
    for (Blob blob : blobs.iterateAll()) {
      // do something with the blob
    }
    // [END listBlobsWithDirectoryAndPrefix]
    return blobs;
  }
343321
function _emptyDirectoryProm (directory) {

			return new Promise((resolve, reject) => {

				readdir(directory, (err, files) => {
					return err ? reject(err) : resolve(files);
				});

			}).then((files) => {

				const result = [];

					for (let i = 0; i < files.length; ++i) {
						result.push(join(directory, files[i]));
					}

				return Promise.resolve(result);

			}).then((files) => {
				return files.length ? _removeDirectoryContentProm(files) : Promise.resolve();
			});

		}
105631
function (name, pkgDir) {
    if (!isString(name) || !isString(pkgDir) ||
         S(name).isEmpty() || S(pkgDir).isEmpty() || !isDirectory.sync(pkgDir)) {
      return 1
    }
    var scope = utils(name, pkgDir)
    try {
      scope.validateIsUnityRoot()
      scope.createModulesDirectoryInAssets()
      scope.createModuleDirectory()
      scope.copyModuleResources()
    } catch (err) {
      scope.cleanupOnPostInstallError()
      scope.printError(err)
      return 1
    }
    return 0
  }
64777
public static <ItemT extends HasDocID> BinaryErrorLogger<ItemT, ItemT> forStringifierAndOutputDir(
      Function<? super ItemT, String> stringifier, File outputDirectory) {
    outputDirectory.mkdirs();
    return new BinaryErrorLogger<ItemT, ItemT>(outputDirectory, stringifier, stringifier);
  }
255099
function FSBackend(loadParameter) {
    this.loaded = false;
    this.index = [];
    this.location = typeof loadParameter === "string" && loadParameter.length > 0 ? loadParameter : process.cwd() + "/cache/";
    this.location = this.location.substr(this.location.length - 1) === "/" ? this.location : this.location + "/";
}
442633
protected String getCachedFileName(String key) throws InterruptedException {
		String result = null;
		if (_moduleBuilds != null) {
			CacheEntry bld = _moduleBuilds.get(key);
			for (int i = 0; i < 5; i++) {
				if (bld.filename == null) {
					Thread.sleep(500L);
				}
			}
			result = _moduleBuilds.get(key).fileName();
		}
		return result;
	}