Skip to content

Is it an error if the href and target options of p:file-move or p:file-copy are the same file? #685

@ndw

Description

@ndw

I don't see a definitive answer in the spec, am I missing something? I guess it partly depends on how you interpret

It is a dynamic error (err:XC0050) the file or directory cannot be copied to the specified location.

I lean towards making it an error. You could argue that "doing nothing" qualifies as copying a file onto itself, but the semantics of moving a file onto itself are more complex. (Do you delete the original which is also the target? No probably not.) And in any event, no one is likely to do this on purpose so it's probably indicative of something having gone wrong. Better to raise an error before something worse happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions