summaryrefslogtreecommitdiff
path: root/file_ops.py
diff options
context:
space:
mode:
authorOwl <isaclien9752@gmail.com>2025-08-23 17:13:49 -0400
committerOwl <isaclien9752@gmail.com>2025-08-23 17:13:49 -0400
commit4bc406964fd6809e8e77b7bb0c5317f5cb94a1a8 (patch)
tree502ef662bd15ea0045b941786ff27a236c23f760 /file_ops.py
parent0ab9e972cb4a4128c2041f6da580a72515b3db64 (diff)
downloadblenxy-4bc406964fd6809e8e77b7bb0c5317f5cb94a1a8.tar.gz
blenxy-4bc406964fd6809e8e77b7bb0c5317f5cb94a1a8.zip
ensure numpy updates
Diffstat (limited to 'file_ops.py')
-rw-r--r--file_ops.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/file_ops.py b/file_ops.py
index b9b3f6f..b482b88 100644
--- a/file_ops.py
+++ b/file_ops.py
@@ -237,3 +237,16 @@ def get_file_size(path):
if (is_file(path) == False):
return 0
return os.path.getsize(get_path_str(path))
+
+# function to rename a folder or a file
+def rename(current_name, new_name):
+ # check params
+ if (f_exists(current_name) == False
+ or f_exists(new_name) == True):
+ return False
+ # reformat the strings
+ current_name = get_path_str(current_name)
+ new_name = get_path_str(new_name)
+ #call os.rename()
+ os.rename(current_name, new_name)
+ return True