Skip to content

Symbolic Links #616

@mildred

Description

@mildred

Symbolic links are not implemented. ipfs add -r on a directory containing a symlink to a directory will fail.

You can reproduce it using:

mkdir -p a/b
ln -s b a/c
touch a/b/c
ipfs add -r a

You get:

Error: Post http://127.0.0.1:5001/api/v0/add?encoding=json&r=true&stream-channels=true: read a/c: is a directory

I think I also got ipfs add -r to stop in the middle of adding because of that. At some point, it would just stop and not continue. Running stat, I found that it thought that the symlink to a directory was a file, and tried to read it:

open("root/ckeditor/plugins/openlink", O_RDONLY|O_CLOEXEC) = 5
read(5, 0xc208130000, 32768)            = -1 EISDIR (Is a directory)
epoll_wait(4, {}, 128, 0)               = 0
futex(0xf2e878, FUTEX_WAIT, 0, NULL)    = 0
futex(0xf2da30, FUTEX_WAKE, 1)          = 1
...

The normal sequence for a directory would be:

open("root/ckeditor/plugins/newpage/lang", O_RDONLY|O_CLOEXEC) = 5
getdents64(5, /* 68 entries */, 4096)   = 2160
getdents64(5, /* 0 entries */, 4096)    = 0
lstat("root/ckeditor/plugins/newpage/lang/fa.js", {st_mode=S_IFREG|0644, st_size=235, ...}) = 0
...

We should implement symbolic links in the unixfs protocol buffer object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions