Documentation
¶
Overview ¶
Package files
- Version: 1.0.0
- Copyright (c) 2021. Pashifika *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
Package files
- Version: 1.0.0
- Copyright (c) 2021. Pashifika *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
Index ¶
- func BufferToFile(path string, r io.Reader) (err error)
- func ByteToFile(path string, buf []byte) (err error)
- func Exists(path string) bool
- func FileOpen(path, mode string) (*os.File, error)
- func GetFileList(path, filter string, fullPath bool) ([]string, error)
- func MkdirIfNotExist(path string) error
- func PathBaseAddPrefix(path, prefix string) string
- func PathBaseAddSuffix(path, suffix string) string
- func RemoveNameExt(name string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BufferToFile ¶
BufferToFile write buffer to file. (best to the big file)
func ByteToFile ¶
ByteToFile write bytes to file. (best to the small file)
func FileOpen ¶
FileOpen os full path.
w open the file write-only. (support create a new file)
r open the file read-only.
a append data to the file when writing. (aw is support create a new file)
rw open the file read-write. (support create a new file)
func GetFileList ¶
GetFileList used regexp filtering files
func MkdirIfNotExist ¶
MkdirIfNotExist used os.MkdirAll to make path's all dir
func PathBaseAddPrefix ¶
PathBaseAddPrefix add prefix to the last element of path.
func PathBaseAddSuffix ¶
PathBaseAddSuffix add suffix to the last element of path.
func RemoveNameExt ¶
RemoveNameExt remove file name's extension used of path.
Types ¶
This section is empty.