Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source and target filename can be the same in the COPY command #174

Closed
jwa1974 opened this issue Oct 4, 2024 · 1 comment
Closed

Source and target filename can be the same in the COPY command #174

jwa1974 opened this issue Oct 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jwa1974
Copy link

jwa1974 commented Oct 4, 2024

Test Environment (required)
You can use MEGA65INFO to retrieve this.

  • Platform: MEGA65 R6
  • ROM Release: 920395 / 920408
  • Core Commit: 3c10488

Describe the bug
When doing a file COPY, where source and target filenames are the same (on the same disk), no error will be issued. The copy will be done, ending up with two files with the same name. Only if copying a second time, with the same names, a "FILE EXISTS" will be issued. Also, the documentation states the names must be different.

To Reproduce
Steps to reproduce the behavior:

  1. Start with a clean disk (image or internal).
  2. Save a test file, eg: DSAVE "FILE".
  3. Do a copy: COPY "FILE" TO "FILE" -> No error!
  4. A DIR will reveal two files with the same name!
  5. Do another copy: COPY "FILE" TO "FILE" -> 63,FILE EXISTS,00,00

Expected behavior
The command should issue an error when source and target filenames are the same (on the same disk) the first time.

Screenshots
copy_bug

Additional context
None.

@jwa1974 jwa1974 added the new New report, not classified yet label Oct 4, 2024
@dansanderson dansanderson added bug Something isn't working and removed new New report, not classified yet labels Oct 6, 2024
@dansanderson
Copy link
Collaborator

I confirmed that this is actually a bug in the virtual disk driver, not the COPY command. Migrating this to: MEGA65/mega65-core#842

The disk device itself is responsible for file duplications. BASIC is just issuing the DOS "C" command. This works as expected for external IEC disk drives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants