Skip to content

Repeated download failures may lead to ENAMETOOLONG #28

@slhck

Description

@slhck

If you always download to the same file, and choose the default existBehavior mode for existing targets (new_file), this will eventually cause the file name to be too long.
For example, I ran into this error during testing:

Error: ENAMETOOLONG: name too long, rename '/var/folders/3h/9h8lqbnx0p372m8qh7fpd1dh0000gn/T/test-config.tar(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY)(COPY).bz2.$$6$PART' ...

I was baffled by the error message at first, but only then I realized that the easydl tool was trying to append (COPY) to a copy it had already created, and so on, eventually making the file name too long.

So, in its default mode, for any application that downloads to a predetermined path, download failures may accumulate and eventually cause cryptic errors.

I am not sure what's the best way to solve this other than changing the default mode for existing files. In my opinion, an existing file should either be silently overwritten (and the user should check that it does not exist), or lead to an error unless a force option is given (and if that is not set, the user must check for any errors).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions