Regression: File recursions work only when I turn on hidden files #103530
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#103530
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 527.56
Blender Version
Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-12-27 16:50, hash:
d7dad425c0
Worked: 3.4
Caused by
2165136740
Short description of error
When I wanna see file recursions, he sees all the recursions as hidden files.
So I need to turn on "show hidden" and only then the recursions are seen. Happens on disk C and other disks too
Exact steps for others to reproduce the error
Open Blender
Ctrl + O
Use recursions
Observe no change in any folder
Show hidden in the filter now you can see the folders/files
Added subscriber: @costa
Added subscribers: @JulianEisel, @ideasman42, @Harley
Changed status from 'Needs Triage' to: 'Confirmed'
@ideasman42 & @JulianEisel : Hard to explain this one.
On the surface this is "just" that files that are not in the current folder get file attributes of "hidden", therefore not visible until we show hidden. This probably also has error behavior in Mac and Linux, but will be different.
Making this harder to diagnose is (my) lack of error checking in
BLI_file_attributes
. If given an invalid path, the return ofGetFileAttributesW
isINVALID_FILE_ATTRIBUTES
, which is -1 and therefore all bits set. So the test for FILE_ATTRIBUTE_HIDDEN is true and so the file is given hidden attribute. This should probably just test for INVALID_FILE_ATTRIBUTES, do a debug-only assert but return zero in release.Why is the path invalid though?
In
filelist_readjob_list_dir
the call tocurrent_relpath_append
appends the recursed path name. Since this folder name is also in the root variable we get a duplication if using BLI_path_join. Following shows the entry relpath and root, both with the same "a" folder name.{F14099307,width=100%}
Create a full path from these parts using BLI_path_join and that folder is duplicated in the path. BLI_file_attributes return "hidden" in that error condition. The invalid path is also used for BLI_file_alias_target.
Not sure how to address if this duplication of the recursed path in relpath and root are by design. I'm guessing so since everything else seems to work.
The mentioned error check (and return zero) would fix this, sort of (at least hide it), but would result in us not being able to deal with files with special attributes, or shortcut files, Mac Aliases, files that need special preview treatment (offline), outside of the current directory.
Added subscriber: @LazyDodo
BLI_file_attributes
has no opportunity to report back "hey this file doesn't actually exist", it seems to operate on the assumption the file path being fed into is valid, adding an additional check and return early would make the issue somewhat go away since it will now return no flags rather than all flags, but the actual issue is a bad path was being presented to it. it could live with the following "fix" forBLI_file_attributes
thoughThe root cause of this problem still needs to be addressed though.
File recursions work only when I turn on hidden filesto Regression: File recursions work only when I turn on hidden filesAdded subscriber: @PratikPB2123
Removed subscriber: @ideasman42
Thanks for bisecting @PratikPB2123 !
If the (new) current behavior (recursed directories duplicated in relname and root) is by design then this would be all that is needed to fix this bug report:
Added subscriber: @ThomasDinges
@JulianEisel Hey Julian, can you please check on this report and the proposed patch?
@Harley this patch is correct. This only worked previously because
entry->relpath
andfiles- [x].relname
were the same for a moment, untilentry->relpath
would be updated properly.Not entirely sure what you mean.
Basically what we have is:
filelist->root
the actual root of the filelist, which we may recurse into.entry->relpath
- the path (including file name) relative tofilelist->root
.files- [x].relname
- just the file name without path.Previously,
entry->relpath
would be the same asfile- [x].rename
at first and only later be updated to be the full relative path.Also, the
root
variable is badly named in this function, since it's notfilelist->root
, just the currently recursed into directory.Ah, that's it. Will just propose this fix and set you as reviewer (only).
Me and Ray will separately fix the error-checking in storage.c
This issue was referenced by
d82ffb9787
Changed status from 'Confirmed' to: 'Resolved'