Skip to content

After loading PCK file, called DirAccess.DirExistsAbsolute method, passing the existing path, returns false. #94793

Closed
@Cold-Mint

Description

@Cold-Mint

Tested versions

Reproducible in:4.2.2-stable, 4.2.2-stable_mono, 4.3-beta3, 4.3-rc1, 4.3-rc1_mono

System information

Godot v4.3.rc1.mono - Windows 10.0.22631 - Vulkan (Mobile) - integrated AMD Radeon(TM) Graphics (Advanced Micro Devices, Inc.; 27.20.11028.10001) - AMD Ryzen 5 4600U with Radeon Graphics (12 Threads)

Issue description

Sample code:

extends Control

func _ready():
  _showFolderInfo("res://data")
  _loadPckFile("D:\\a.pck")
  _showFolderInfo("res://data")
  pass

#Load the PCK package
#加载PCK包
func _loadPckFile(path):
  print("Load Pck File at " + path)
  var result = ProjectSettings.load_resource_pack(path)
  print("Load Pck " + path + ",Result is " + str(result))
  pass

#Show folder information
#显示文件夹信息
func _showFolderInfo(path):
  if (DirAccess.dir_exists_absolute(path)):
    print("dir exist " + path)
    var files = DirAccess.get_files_at(path)
    for f in files:
        print(str(f))
  else:
    printerr("dir not exist " + path)
  pass

Output:

dir exist res://data
Test1.tscn
Test2.tscn
Test3.tscn
Load Pck File at D:\a.pck
Load Pck D:\a.pck,Result is true
dir not exist res://data

Expect: The DirAccess.dir_exists_absolute method return true after load the PCK file.
Actual: DirAccess.dir_exists_absolute return false.

Steps to reproduce

  1. Download PCKproject.zip and DirExistsErrorMRP.zip
  2. Unzip them to your working directory
  3. Open PCKproject using any of the editors listed below.
  • 4.2.2-stable
  • 4.2.2-stable_mono
  • 4.3-beta3
  • 4.3-rc1
  • 4.3-rc1_mono
  1. Export the pck file and save it to any path.
  2. Open the main.gd file in DirExistsErrorMRP, modify line 5 _loadPckFile(), and pass it to the pck file path.
  3. Run DirExistsErrorMRP.

Minimal reproduction project (MRP)

DirExistsErrorMRP.zip
PCKproject.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions