Menu

#45 directory copied despite not found

4.12.0
closed
None
9
2024-02-29
2023-01-23
rno
No

hi,
I maybe found a small error...

while trying copying a directory contained within a recently renamed -on the other side- another,
despite worker reports an error about the directory not being found,
the directory gets copied anyway, without its content.

steps to trigger the error:
starting with both panels showing the same path, as /tmp

lpanel
create dir a

rpanel
cd a
create dir b
add some files in b then
cd a

lpanel
rename a as a1

rpanel
copy b to other side

an error window pops up

can't read directory
/tmp/a/b
because of this error:
No such file or directory
[OK]

the error:
lpanel
-> a /tmp/b/ directory is made anyway
-> /tmp/b/ is without content

if a user doesn't verify the directory content,
it could seem the operation was done correctly.
so it did seem to me worth reporting.

tested with worker versions 3.15.3 & 4.11.0

if it was a file it would trigger an error popup window

Failed to open the file filename [Skip] [Cancel]

either way, skip or cancel, the file isn't copied.

expected:
-maybe the directory shouldn't be copied
-maybe some style of updating on the listers having the directory that changed name in their cache
-maybe something else

thanks,

Discussion

  • Ralf Hoffmann

    Ralf Hoffmann - 2023-02-14

    Yes, this can be really misleading. I will add a dialog asking to continue, skip or cancel to make this more clear. I will also show a dialog at the end listing all elements that could not be copied correctly. I think updating the directory is not possible since a rename cannot (easily) detected so it is unclear what the new name would be. And such an error can also happen if a file or directory is renamed during the copy process.

     
  • Ralf Hoffmann

    Ralf Hoffmann - 2023-03-04
    • status: open --> closed
    • assigned_to: Ralf Hoffmann
     
  • Ralf Hoffmann

    Ralf Hoffmann - 2023-03-04
    • Group: next --> 4.12.0
     
  • rno

    rno - 2024-02-29

    hi,

    !! only a curiosity remark/ fun fact type a post, probably nothing practical !!

    along the year since posting, I found some programs, as my terminal, are updating their cwd paths if changing it with another program.

    I searched, I found a way doing a c program managing to get the changed path name, using the description in openat manual page:

    • the file descriptor is a stable reference to the directory,
    ** even if the directory is renamed**;

    it goes with file descriptor, and with finding that while opendirat() doesn't exist on linux, there's another function named fdopendir()

    so it is possible, yet limits are unclear my side.
    there are cases directory is found to be empty, and it would matter additionnal checks... I don't know fd well so if wanting something solid it would matter additionnal research.

    see small program attached

     

Log in to post a comment.