filesystems - Checking if a folder exists
问题描述
I am looking for a good way of checking whether a folder exists from within a Julia script. For now what I am doing is:
function dir_exists(dir)
exists = true
try
readdir(dir)
catch err
exists = false
end
exists
end
but I was wonder if there's a way that doesn't rely on exception handling.
解决方案
您正在寻找的功能是isdir
.
推荐阅读
- jquery - 我可以使用 jQuery 来检测 ID 是否存在任何 CSS 样式吗?
- javascript - 我在 mousemove 上将图像附加到光标上。它一直有效,直到我滚动,分离图像,在页面上向上移动
- angularjs - 获取 firebase.database 不是函数?
- performance - 站点在第一次加载非常慢的 IIS 调试
- neo4j - 是否可以在 CYPHER 中设置(复制)另一个节点的标签?
- reactjs - 在 React Hooks 中使用函数 useEffect() 的问题
- java - 如何从节点获取列表并在 recyclerView 中使用该列表从 firebase 获取数据
- javascript - 使用对象键值对动态创建变量?
- android - 我可以将 Firebase 更新通知发送到 Playstore 上早期没有 Firebase 连接的旧版应用程序吗?
- python - Python 烧瓶 - request.data.get