mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 18:11:01 -05:00
use openspace fileExists function
This commit is contained in:
@@ -6,14 +6,8 @@ asset.require("scene/solarsystem/planets/earth/earth")
|
||||
|
||||
local localBookmarks = openspace.absPath("${USER}/bookmarks/localbookmarks.csv")
|
||||
|
||||
-- Returns true if the file exists and can be opened for reading and false otherwise
|
||||
function file_exists(name)
|
||||
local f=io.open(name,"r")
|
||||
return f~=nil and io.close(f)
|
||||
end
|
||||
|
||||
-- Create bookmarks file if it does not exist
|
||||
if not file_exists(localBookmarks) then
|
||||
if not openspace.fileExists(localBookmarks) then
|
||||
local file = io.open(localBookmarks, "w")
|
||||
file:write(
|
||||
"Group (optional),Name (required),Globe (optional),Lat (required if globe)," ..
|
||||
|
||||
Reference in New Issue
Block a user