1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

test v -live message.v

This commit is contained in:
Alexander Medvednikov
2019-12-05 00:14:23 +03:00
parent 2144c162c4
commit e707ac4f28
3 changed files with 25 additions and 7 deletions

View File

@@ -858,11 +858,15 @@ pub fn is_dir(path string) bool {
// is_link returns a boolean indicating whether the given path is a link.
pub fn is_link(path string) bool {
statbuf := C.stat{}
if C.lstat(path.str, &statbuf) != 0 {
return false
$if windows {
return false // TODO
} $else {
statbuf := C.stat{}
if C.lstat(path.str, &statbuf) != 0 {
return false
}
return int(statbuf.st_mode) & S_IFMT == S_IFLNK
}
return int(statbuf.st_mode) & S_IFMT == S_IFLNK
}
// chdir changes the current working directory to the new directory path.