Closed Haruma-VN closed 6 months ago
no error on my device. 400+- chars path:
Can it write the file on your system? For me the error
file != nullptr
still occur. When I modify the Kernel it becomes regular.
On my device, the tool can read/write long path files. Does this problem also occur in shellgui and helper?
For me they occur in all Shell environment. It seems like this relate to Kernel?
@twinkles-twinstar when reading it is normal but when write it is not, can you check it?
Below is the script, note that i write to the same file path.
I tested this script and on my device, the \\?\
prefix has no effect on reading and writing files.
It seems that Windows does not allow us to use _wfopen to create files with too long names (although the total length can exceed 260, a single name still cannot be too long).
In your screenshot, writing the file failed because 100000...
is too long; reading the file succeeded because the end of 100000...
was deleted from the file name (I guess you If you create a file through explorer, it will automatically delete the end part of the file name that is too long). If you compare carefully, you can see that the file being read and the file you wish to write are different.
As shown in the figure below, even if the \\?\
prefix is used, the file name that is too long is still illegal (Figure 2).
I tried to use the Kernel to write the file on my Windows OS (the path have more than 260 characters), below is the script (The directory is already existed, so it is not the bug come from me), I think you should add the prefix "\\?\" for Windows machine: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170
In
Kernel/kernel/utility/file_system/file_system.hpp
line157
make this change:test.zip