Remove the specified file

@param {string} filePath the relative path (from the project root) to remove
@return {RSVP.Promise}
979163
function (filePath) {
    var projectRoot = this.project.root
    var fullPath = resolve(projectRoot, filePath)

    return RSVP.denodeify(unlink)(fullPath)
  }
1132852
def remove(path, **kwargs):
    '''
    
    '''
    path = os.path.expanduser(path)

    if not os.path.isabs(path):
        raise SaltInvocationError('File path must be absolute: {0}'.format(path))

    try:
        if os.path.isfile(path) or os.path.islink(path):
            os.remove(path)
            return True
        elif os.path.isdir(path):
            shutil.rmtree(path)
            return True
    except (OSError, IOError) as exc:
        raise CommandExecutionError(
            'Could not remove \'{0}\': {1}'.format(path, exc)
        )
    return False
1117221
function() {

        // TODO: should really use link to GeneratedFileNode.prototype.clean() here
        var _this = this;
        return QFS.remove(this.getPath())
            .then(function() {
                LOGGER.fverbose('[-] Removed %j', _this.getId());
            })
            .fail(function() {});

    }
174348
function writeFile(filePath, contents) {
  return new Promise((resolve, reject) => {
    fs.writeFile(filePath, contents, 'utf-8', (err, file) => {
      err ? reject(err) : resolve();
    })
  });
}
540533
function stripProjectRoot (projectRoot, filePath) {
  if (typeof filePath === 'string') {
    // Check whether the path is an posix absolute file, otherwise check whether it's a
    // win32 valid absolute file. The order is important here because win32 treats posix
    // absolute paths as absolute, but posix doesn't do the same for win32.
    const p = path.posix.isAbsolute(filePath) ? path.posix
      : path.win32.isAbsolute(filePath) ? path.win32
        : null
    if (p) {
      const relative = p.relative(projectRoot, filePath)
      if (relative.indexOf('.') !== 0) {
        return relative
      }
    }
  }
  return filePath
}
879596
function (filePath) {
        const tmpDir = path.join(os.tmpdir(), uuid.v4());
        this.fileToDelete = tmpDir;

        return Promise.promisify(extract)(filePath, {dir: tmpDir}).then(function () {
            return tmpDir;
        });
    }
1170311
function (filePath) {

            var pos = filePath.lastIndexOf("\\");
            if (pos !== -1) {
                filePath = filePath.substr(pos + 1);
            }

            pos = filePath.lastIndexOf("/");
            if (pos !== -1) {
                filePath = filePath.substr(pos + 1);
            }

            return filePath;
        }
63329
function write(filepath, contents) {
  return new Promise((resolve, reject)=>{
    fs.writeFile(filepath, contents, (err, response)=>{
      if (err) return reject(err);
      return resolve(response);
    })
  });
}
365903
protected function removeTemporaryFiles($filepath, $force = false)
	{
		if ($force || $filepath !== $this->getUncompressedFilepath($filepath)) {
			$this->getBackupFilesystemInstance()->removeFile($this->getUncompressedFilepath($filepath));
		}
	}
126123
function(hoast, filePath, content) {
	return new Promise(function(resolve, reject) {
		hoast.helpers.createDirectory(path.dirname(filePath))
			.then(function() {
				fs.writeFile(filePath, JSON.stringify(content), `utf8`, function(error) {
					if (error) {
						return reject(error);
					}
					resolve();
				});
			})
			.catch(function(error) {
				reject(error);
			});
	});
}
674687
function readdirAsync(filepath){
	return new Promise((resolve, reject)=>{
		fs.readdir(filepath, (err, items)=>{
			if (err) reject(err)
			else resolve(items)
		})
	})
}
951840
function (filePath)
    {
        if (0 === filePath.indexOf(process.cwd()))
        {
            filePath = path.relative(process.cwd(), filePath);
        }

        if (0 !== filePath.indexOf("./") && 0 !== filePath.indexOf("/"))
        {
            filePath = "./" + filePath;
        }

        return filePath;
    }
743449
public function delete( $filePath )
    {
        $map = $this->mapFilePathArray( (array)$filePath );

        $returnValue = true;
        /** @var eZDFSFileHandlerDFSBackendInterface $handler */
        foreach ( $map['handlers'] as $handlerClass => $handler )
        {
            $returnValue &= $handler->delete( $map['files'][$handlerClass] );
        }

        return (bool)$returnValue;
    }
325276
public void deleteInternal(String filePath, boolean recursive) {
        //Process and validate path
        final String processedPath = processAndValidateFilePath(filePath, false);

        boolean deleted;
        if (recursive) {
            File fileToDelete = new File(processedPath);
            if (FileUtils.fileIsDirectory(fileToDelete)) {
                recursiveDelete(fileToDelete);
            } else {
                FileUtils.fileDelete(fileToDelete);
            }
            deleted = FileUtils.fileExists(fileToDelete) == false;
        } else {
            deleted = deleteLocalFile(processedPath);
        }

        if (!deleted) {
            IOException ioe = new IOException(TraceNLS.getFormattedMessage(this.getClass(),
                                                                           APIConstants.TRACE_BUNDLE_FILE_TRANSFER,
                                                                           "DELETE_REQUEST_ERROR",
                                                                           null,
                                                                           "CWWKX0126E: Delete request for file " + processedPath + " could not be completed."));
            throw ErrorHelper.createRESTHandlerJsonException(ioe, null, APIConstants.STATUS_BAD_REQUEST);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isInfoEnabled()) {
            Tr.info(tc, "DELETE_REQUEST_COMPLETE_INFO", processedPath);
        }
    }
174603
function(key) {
    var filepath = this._makeFilepath(key);

    if (!fs.existsSync(filepath)) {
      return;
    }

    fs.unlinkSync(filepath);
  }
815373
function () {
    var promptRemove = this._promptRemove.bind(this)
    var removeFile = this._removeFile.bind(this)
    var ui = this.ui

    return this._findConfigFiles()
      .then(function (files) {
        if (files.length === 0) {
          ui.writeLine('No JSHint or ESLint config files found.')
          return RSVP.resolve({
            result: {
              deleteFiles: 'none'
            }
          })
        }

        ui.writeLine('\nI found the following JSHint and ESLint config files:')
        files.forEach(function (file) {
          ui.writeLine('  ' + file)
        })

        var promptPromise = ui.prompt({
          type: 'list',
          name: 'deleteFiles',
          message: 'What would you like to do?',
          choices: [
            { name: 'Remove them all', value: 'all' },
            { name: 'Remove individually', value: 'each' },
            { name: 'Nothing', value: 'none' }
          ]
        })

        return RSVP.hash({
          result: promptPromise,
          files: files
        })
      }).then(function (data) {
        var value = data.result.deleteFiles
        var files = data.files

        // Noop if we're not deleting any files
        if (value === 'none') {
          return RSVP.resolve()
        }

        if (value === 'all') {
          return RSVP.all(files.map(function (fileName) {
            return removeFile(fileName)
          }))
        }

        if (value === 'each') {
          return synchronize(files, function (fileName) {
            return promptRemove(fileName)
          })
        }
      })
  }
395544
async function deployToIPFS(filePath) {
  console.log('Uploading to IPFS...');

  return new Promise((resolve, reject) => {
    exec(`ipfs add ${filePath}`, { }, (err, stdout, stderr) => {
      if (err) {
        reject({ err, stderr });
      } else {
        resolve(stdout.split(' ')[1]);
      }
    })
  })
}