新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)GoFrame教程:GoFrame gfile-類型判斷
類型判斷
IsDir

10年積累的成都網(wǎng)站設(shè)計、成都網(wǎng)站制作經(jīng)驗,可以快速應(yīng)對客戶對網(wǎng)站的新想法和需求。提供各種問題對應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認識你,你也不認識我。但先網(wǎng)站設(shè)計后付款的網(wǎng)站建設(shè)流程,更有志丹免費網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
- 說明:檢查給定的路徑是否是文件夾。
- 格式:
func IsDir(path string) bool- 示例:
func ExampleIsDir() {
// init
var (
path = gfile.TempDir("gfile_example_basic_dir")
filePath = gfile.Join(gfile.TempDir("gfile_example_basic_dir"), "file1")
)
// Checks whether given `path` a directory.
fmt.Println(gfile.IsDir(path))
fmt.Println(gfile.IsDir(filePath))
// Output:
// true
// false
}IsFile
- 說明:檢查給定的路徑是否是文件。
- 格式:
func IsFile(path string) bool- 示例:
func ExampleIsFile() {
// init
var (
filePath = gfile.Join(gfile.TempDir("gfile_example_basic_dir"), "file1")
dirPath = gfile.TempDir("gfile_example_basic_dir")
)
// Checks whether given `path` a file, which means it's not a directory.
fmt.Println(gfile.IsFile(filePath))
fmt.Println(gfile.IsFile(dirPath))
// Output:
// true
// false
} 文章名稱:創(chuàng)新互聯(lián)GoFrame教程:GoFrame gfile-類型判斷
地址分享:http://m.5511xx.com/article/cosgpdj.html


咨詢
建站咨詢
