From 5bb5300afe3695f1e27b6b590f1be8e545e2d0ca Mon Sep 17 00:00:00 2001 From: LE Quoc Dat Date: Fri, 18 Apr 2025 17:02:22 +0100 Subject: [PATCH] fix windows path --- backend/sandbox/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/sandbox/api.py b/backend/sandbox/api.py index de4d2e47..33effa6f 100644 --- a/backend/sandbox/api.py +++ b/backend/sandbox/api.py @@ -151,9 +151,11 @@ async def list_files( for file in files: # Convert file information to our model + # Ensure forward slashes are used for paths, regardless of OS + full_path = f"{path.rstrip('/')}/{file.name}" if path != '/' else f"/{file.name}" file_info = FileInfo( name=file.name, - path=os.path.join(path, file.name), + path=full_path, # Use the constructed path is_dir=file.is_dir, size=file.size, mod_time=str(file.mod_time),