Remove file

@param {string} filename

@callback callback
@param {string|boolean} error
@param {string} filename



@private
778776
function(filename, callback) {
        fs.unlink(filename, function(err){
            if (err) {
                console.error(err.stack);
                callback(err)
            } else {
                callback(false)
            }
        })
    }
1176297
public void removeFile(String filename) throws SftpStatusException,
			SshException {
		try {
			UnsignedInteger32 requestId = nextRequestId();
			Packet msg = createPacket();
			msg.write(SSH_FXP_REMOVE);
			msg.writeInt(requestId.longValue());
			msg.writeString(filename, CHARSET_ENCODING);

			sendMessage(msg);

			getOKRequestStatus(requestId);
		} catch (SshIOException ex) {
			throw ex.getRealException();
		} catch (IOException ex) {
			throw new SshException(ex);
		}
		EventServiceImplementation.getInstance()
				.fireEvent(
						(new Event(this,
								J2SSHEventCodes.EVENT_SFTP_FILE_DELETED, true))
								.addAttribute(
										J2SSHEventCodes.ATTRIBUTE_FILE_NAME,
										filename));
	}
167847
private boolean deleteFile(String filename) throws Exception {
        if (filename == null) {
            return false;
        }
        File file = new File(storeDir, filename);
        return Files.deleteIfExists(file.toPath());
    }
819768
def _removeIfPresent(filename):
    
    try:
        os.unlink(filename)
    except OSError as why:
        if why.errno == ENOENT:
            # Someone beat us to it, but it's gone, so that's OK
            return 0
        else:
            raise
    else:
        # File was present
        return 1
707257
function () {
        var self = this;

        if (self.fileToDelete === null) {
            return;
        }

        fs.remove(self.fileToDelete, function (err) {
            if (err) {
                common.logging.error(new common.errors.GhostError({
                    err: err,
                    context: common.i18n.t('errors.data.importer.index.couldNotCleanUpFile.error'),
                    help: common.i18n.t('errors.data.importer.index.couldNotCleanUpFile.context')
                }));
            }

            self.fileToDelete = null;
        });
    }
855793
function(filename, gnaFolder, content, callback){
        if ( fs.existsSync(filename) ) {
            fs.unlinkSync(filename)
        }
        fs.appendFile(
            filename,
            JSON.stringify(content, null, '\t'),
            null,
            function(err){
                if (err) {
                    //logger.error('gina', 'UTILS:CONFIG:ERR:2', err, __stack);
                    console.error('`Error on while calling createContent()`: ' + err.stack||err.message);
                    callback(err)
                } else {
                    setTimeout(function(){
                        callback(err)
                    }, 1000)
                }
            }//EO function
        )//EO fs.appendFile
    }
220100
function(index)
  {
    //Check the index
    if(index >= files.length)
    {
      //Do the callback
      return cb(null);
    }

    //Get the file to remove
    var file = files[index];

    //Remove the file
    fs.unlink(file, function(error)
    {
      //Check the error
      if(error)
      {
        //Check the error code
        if(error.code !== 'ENOENT')
        {
          //Do the callback with the error
          return cb(error);
        }
      }

      //Continue with the next file
      return remove_file(index + 1);
    });
  }
424126
function onDelete( error ) {
			if ( error ) {
				debug( 'Error encountered while attempting to delete a temporary output file %s: %s', outFile, error.message );
				return done( error );
			}
			debug( 'Successfully deleted temporary output file: %s', outFile );
			done( null, file );
		}
1063970
private void cleanupErrorFile(Watcher watcher) {
        File file = getErrorFileForWatcher(watcher);
        FileUtils.deleteQuietly(file);
    }
610536
function errorHandler (error, file) {
	let filePath = (error.file === 'stdin' ? file.path : error.file) || file.path;
	let relativePath = path.relative(process.cwd(), filePath);

	let msg = [
		colors.underline(relativePath),
		'',
		error.formatted
	].join('\n');

	return new PluginError(pkg.name, msg);
}
908418
def remove(self, filename):
        
        output = self.shell('rm', filename)
        # any output means rm failed.
        return False if output else True
870206
function verifyFileName (fileName)
{
    // if fileName undefined or null, throw exception
    if ((fileName === undefined) || (fileName === null)) {
        var message1 = format (cc.MSG_INVALID_NAME);
        throw new SafeFileError (cc.INVALID_NAME, message1);
    }
}
636354
def delete_if_error(path):
    ''''''
    try:
        yield
    except Exception:
        if os.path.exists(path):
            os.remove(path)
        raise
1179042
function(filePath, callback) {
	if (!fs.existsSync(filePath)) {
		errorHandler("File " + filePath + " does not exist. Please specify a valid path.");
	}
	var body = '';
	var reader = fs.createReadStream(filePath);
	reader.on('data', function(chunks) {
		body += chunks;
	}).on('end', function() {
		callback(body);
	}).on('error', function(e) {
		throw e;
	});
}
195156
private void delete(String name) {
        File f = new File(name);
        if (f.exists()) {
            f.delete();
        }
    }
991452
function (filename, fn) {

		fn = fn || function () {};

		this._image.pack().pipe(fs.createWriteStream(filename)).once('close', function () {
			this._image.removeListener('error', fn);
			fn(undefined, this);
		}.bind(this)).once('error', function (err) {
			this._image.removeListener('close', fn);
			fn(err, this);
		}.bind(this));
	}
128786
function MkdirForFile($filename,&$error = null,&$error_str = null){
		$directory = preg_replace('/[^\/]+$/','',$filename);
		if(!strlen($directory)){
			$error = true;
			$error_str = "can't determine directory name";
			return;
		}
		return self::Mkdir($directory,$error,$error_str);
	}