Skip to content

feat(File): Add copy() and moveTo() methods #49

@usernane

Description

@usernane

Problem Statement

The File class supports read, write, create, and remove, but has no way to copy or move a file. Users must manually read + write + remove to achieve this.

Proposed Solution

Add two methods:

  • copy(string $destination): File — copies the file to a new path, returns a new File instance for the copy
  • moveTo(string $destination): void — moves the file to a new path, updates the current instance's path

Alternatives Considered

  • Only adding copy() and implementing moveTo() as copy + remove

Breaking Change

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions