// DeleteFile - delete a file at path.
334699
func (s *posix) DeleteFile(volume, path string) (err error) {
	defer func() {
		if err == errFaultyDisk {
			atomic.AddInt32(&s.ioErrCount, 1)
		}
	}()

	if atomic.LoadInt32(&s.ioErrCount) > maxAllowedIOError {
		return errFaultyDisk
	}

	if err = s.checkDiskFound(); err != nil {
		return err
	}

	volumeDir, err := s.getVolDir(volume)
	if err != nil {
		return err
	}
	// Stat a volume entry.
	_, err = os.Stat((volumeDir))
	if err != nil {
		if os.IsNotExist(err) {
			return errVolumeNotFound
		} else if isSysErrIO(err) {
			return errFaultyDisk
		}
		return err
	}

	// Following code is needed so that we retain "/" suffix if any in
	// path argument.
	filePath := pathJoin(volumeDir, path)
	if err = checkPathLength((filePath)); err != nil {
		return err
	}

	// Delete file and delete parent directory as well if its empty.
	return deleteFile(volumeDir, filePath)
}
1022462
func (s *FileSystemStorage) Delete(filepath string) error {
	return os.Remove(s.Path(filepath))
}
966295
func Delete(path string, h interface{}, m ...interface{}) {
	Default.Delete(path, h, m...)
}
998274
func (m *DatastoreFileManager) DeleteFile(ctx context.Context, name string) error {
	p := m.Path(name)

	task, err := m.FileManager.DeleteDatastoreFile(ctx, p.String(), m.Datacenter)
	if err != nil {
		return err
	}

	return m.wait(ctx, task)
}
296580
func deferDeleteTempFile(path string) {
	tempFilesMu.Lock()
	tempFiles = append(tempFiles, path)
	tempFilesMu.Unlock()
}
472995
func (d *S3Driver) DeleteFile(path string) bool {
	svc := d.s3service()
	path = strings.TrimPrefix(path, "/")

	params := &s3.DeleteObjectInput{
		Bucket: aws.String(d.AWSBucketName), // Required
		Key:    aws.String(path),            // Required
	}
	_, err := svc.DeleteObject(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
		return false
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
		return false
	}

	return true
}
1056465
func (db *DB) DeleteFile(name string) {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	C.rocksdb_delete_file(db.c, cName)
}
685063
func ReadFile(path string) ([]byte, error) {
	file, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer Close(file)
	data, err := ioutil.ReadAll(file)
	if err != nil {
		return nil, err
	}
	return data, nil
}
838887
func (f *azureFileClient) deleteFileShare(accountName, accountKey, name string) error {
	fileClient, err := f.getFileSvcClient(accountName, accountKey)
	if err != nil {
		return err
	}
	return fileClient.GetShareReference(name).Delete(nil)
}
468507
func deleteFile(filename string) error {
	if fileExists(filename) {
		return os.Remove(filename)
	}
	return nil
}
1180351
func (s ErrCountFS) Delete(ctx context.Context, path string) error {
	err := s.fs.Delete(ctx, path)
	if err == s.err {
		s.status.Add("delete.count", 1)
	}
	s.status.Add("delete.total", 1)
	return err
}
785916
func Delete(path string, recs []Record) error {
	defer pathLock(path)()

	if len(recs) == 0 {
		return nil
	}
	old, err := os.Open(path)
	if err != nil {
		return err
	}

	var buf bytes.Buffer

	s := bufio.NewScanner(old)
	eol := []byte{'\n'}
loop:
	for s.Scan() {
		b := s.Bytes()
		if len(b) == 0 {
			continue
		}

		if b[0] == '#' {
			buf.Write(b)
			buf.Write(eol)
			continue
		}
		for _, r := range recs {
			if bytes.HasSuffix(b, []byte("\t"+r.Hosts)) {
				continue loop
			}
		}
		buf.Write(b)
		buf.Write(eol)
	}
	old.Close()
	if err := s.Err(); err != nil {
		return err
	}
	return ioutil.WriteFile(path, buf.Bytes(), 0644)
}
95001
func (a *API) Delete(path string, f func(http.ResponseWriter, *http.Request)) {
	a.router.Del(path, http.HandlerFunc(f))
}
834652
func fsDeleteFile(ctx context.Context, basePath, deletePath string) error {
	if err := checkPathLength(basePath); err != nil {
		logger.LogIf(ctx, err)
		return err
	}

	if err := checkPathLength(deletePath); err != nil {
		logger.LogIf(ctx, err)
		return err
	}

	if err := deleteFile(basePath, deletePath); err != nil {
		if err != errFileNotFound {
			logger.LogIf(ctx, err)
		}
		return err
	}
	return nil
}
438249
func (z *ZkPlus) Delete(path string, version int32) error {
	z.forPath(path).Log(logkey.ZkMethod, "Delete")
	return z.blockOnConn().Delete(z.realPath(path), version)
}
411057
func (rd *RAMDirectory) DeleteFile(name string) error {
	rd.EnsureOpen()
	rd.fileMapLock.RLock()
	defer rd.fileMapLock.RUnlock()
	if file, ok := rd.fileMap[name]; ok {
		file.directory = nil
		atomic.AddInt64(&rd.sizeInBytes, -file.sizeInBytes)
		return nil
	}
	return errors.New(name)
}
585619
func (e *Echo) Delete(path string, h interface{}, m ...interface{}) {
	e.add(DELETE, "", path, h, m...)
}