diff options
Diffstat (limited to 'core/os/dir_access.cpp')
-rw-r--r-- | core/os/dir_access.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index 53fe792c46..a1031cf5f0 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -399,6 +399,15 @@ Error DirAccess::copy(String p_from,String p_to) { return err; } +bool DirAccess::exists(String p_dir) { + + DirAccess* da = DirAccess::create_for_path(p_dir); + bool valid = da->change_dir(p_dir)==OK; + memdelete(da); + return valid; + +} + DirAccess::DirAccess(){ _access_type=ACCESS_FILESYSTEM; |