Update `is_writeable()` for 2 methods
diff --git a/utils/general.py b/utils/general.py
index 6201320d3c6..e8b158a773d 100755
--- a/utils/general.py
+++ b/utils/general.py
@@ -112,17 +112,19 @@ def user_config_dir(dir='Ultralytics'):
     return path
 
 
-def is_writeable(dir):
-    # Return True if directory has write permissions
-    # return os.access(path, os.R_OK)  # known issue on Windows
-    file = Path(dir) / 'tmp.txt'
-    try:
-        with open(file, 'w'):
-            pass
-        file.unlink()  # remove file
-        return True
-    except IOError:
-        return False
+def is_writeable(dir, test=False):
+    # Return True if directory has write permissions, test opening a file with write permissions if test=True
+    if test:  # method 1
+        file = Path(dir) / 'tmp.txt'
+        try:
+            with open(file, 'w'):  # open file with write permissions
+                pass
+            file.unlink()  # remove file
+            return True
+        except IOError:
+            return False
+    else:  # method 2
+        return os.access(dir, os.R_OK)  # possible issues on Windows
 
 
 def is_docker():



## 🛠️ PR Summary

<sub>Made with ❤️ by [Ultralytics Actions](https://github.com/ultralytics/actions)<sub>

### 🌟 Summary
Enhanced directory write permission checking in Ultralytics YOLOv5's utility functions.

### 📊 Key Changes
- 🛠️ Modified the `is_writeable` function in `utils/general.py` to include two methods for checking directory write permissions.
- ✨ Added a `test` parameter to the existing function to toggle between the original file creation method (method 1) and a new method using `os.access` (method 2).

### 🎯 Purpose & Impact
- 💡 The purpose is to improve the reliability of the write permission check across different environments, including potential edge cases on Windows.
- 🔒 Potential Impact: Provides users and developers with a more robust way to determine if a directory is writeable, which can prevent errors and improve the overall experience when interacting with file systems.