Skip to content

Conversation

@pepe
Copy link
Member

@pepe pepe commented Sep 16, 2025

Separated parts with a space and added /-i switch, which turns off the prompt by the xcopy command. I encountered this bug while trying to create the quickbin with spork/declare-cc, and it stuck.

Separated parts with a space and added /-i switch, which disables prompt
by the xcopy command. I found this bug, when I was trying to create the
quickbin with `spork/declare-cc`.
@sogaiu
Copy link
Contributor

sogaiu commented Sep 16, 2025

Got curious about /-i. Didn't see it here. May be what was intended is /-y?

@pepe
Copy link
Member Author

pepe commented Sep 16, 2025

Ok, it is a Windows 11 thing. This is the result of the invocation of xcopy /? on my computer, verbatim:

xcopy /?
Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
                           [/C] [/I] [/-I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T]
                           [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/J]
                           [/EXCLUDE:file1[+file2][+file3]...] [/COMPRESS]
                           [/[-]SPARSE] [/NOCLONE]

  source       Specifies the file(s) to copy.
  destination  Specifies the location and/or name of new files.
  /A           Copies only files with the archive attribute set,
               doesn't change the attribute.
  /M           Copies only files with the archive attribute set,
               turns off the archive attribute.
  /D:m-d-y     Copies files changed on or after the specified date.
               If no date is given, copies only those files whose
               source time is newer than the destination time.
  /EXCLUDE:file1[+file2][+file3]...
               Specifies a list of files containing strings.  Each string
               should be in a separate line in the files.  When any of the
               strings match any part of the absolute path of the file to be
               copied, that file will be excluded from being copied.  For
               example, specifying a string like \obj\ or .obj will exclude
               all files underneath the directory obj or all files with the
               .obj extension respectively.
  /P           Prompts you before creating each destination file.
  /S           Copies directories and subdirectories except empty ones.
  /E           Copies directories and subdirectories, including empty ones.
               Same as /S /E. May be used to modify /T.
  /V           Verifies the size of each new file.
  /W           Prompts you to press a key before copying.
  /C           Continues copying even if errors occur.
  /I           If destination does not exist and copying more than one file,
               assumes that destination must be a directory.
  /-I          If destination does not exist and copying a single specified file,
               assumes that destination must be a file.
  /Q           Does not display file names while copying.
  /F           Displays full source and destination file names while copying.
  /L           Displays files that would be copied.
  /G           Allows the copying of encrypted files to destination that does
               not support encryption.
  /H           Copies hidden and system files also.
  /R           Overwrites read-only files.
  /T           Creates directory structure, but does not copy files. Does not
               include empty directories or subdirectories. /T /E includes
               empty directories and subdirectories.
  /U           Copies only files that already exist in destination.
  /K           Copies attributes. Normal Xcopy will reset read-only attributes.
  /N           Copies using the generated short names.
  /O           Copies file ownership and ACL information.
  /X           Copies file audit settings (implies /O).
  /Y           Suppresses prompting to confirm you want to overwrite an
               existing destination file.
  /-Y          Causes prompting to confirm you want to overwrite an
               existing destination file.
  /Z           Copies networked files in restartable mode.
  /B           Copies the Symbolic Link itself versus the target of the link.
  /J           Copies using unbuffered I/O. Recommended for very large files.
  /COMPRESS    Request network compression during file transfer where
               applicable.
  /[-]SPARSE   Enable or disable retaining the sparse state of files during
               copy. /-SPARSE overrides /SPARSE if both are provided.
  /NOCLONE     Do not attempt block cloning as an optimization.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.

@pepe pepe marked this pull request as draft September 16, 2025 08:28
@pepe
Copy link
Member Author

pepe commented Sep 16, 2025

I need to test it on the POSIX. Converted to draft for the moment.

@pepe
Copy link
Member Author

pepe commented Sep 16, 2025

Strangely, on my Alpine WSL, everything is OK. May I ask @sogaiu to check the tests on your Linux machine?

@sogaiu
Copy link
Contributor

sogaiu commented Sep 16, 2025

With 5cb7db9 I get some error output using janet-pm test. Below is approximately where it starts:

running test/suite-sh.janet ...
cp: cannot create regular file 'test/assets/18/test.file': No such file or directory
error: No such file or directory: test/assets/18/test.file
  in os/rm [src/core/os.c] on line 2139
  in thunk [test/suite-sh.janet] (tail call) on line 44, column 12
non-zero exit code in test/suite-sh.janet: 1
running test/suite-tarray.janet ...
test suite test/suite-tarray.janet finished in 0.002 seconds - 44 of 44 tests passed.
running test/suite-temple.janet ...
test suite test/suite-temple.janet finished in 0.001 seconds - 8 of 8 tests passed.
running test/suite-test.janet ...
Hello world!
test suite test/suite-test.janet finished in 0.019 seconds - 240 of 240 tests passed.
running test/suite-utf8.janet ...
test suite test/suite-utf8.janet finished in 0.000 seconds - 33 of 33 tests passed.
running test/suite-zip.janet ...
test suite test/suite-zip.janet finished in 0.000 seconds - 1 of 1 tests passed.
✘ Failing test scripts: 1

Similar output with jpm test I think:

running test/suite-sh.janet ...
cp: cannot create regular file 'test/assets/18/test.file': No such file or directory
error: No such file or directory: test/assets/18/test.file
  in os/rm [src/core/os.c] on line 2139
  in thunk [test/suite-sh.janet] (tail call) on line 44, column 12
non-zero exit code in test/suite-sh.janet: 1
running test/suite-tarray.janet ...
test suite test/suite-tarray.janet finished in 0.002 seconds - 44 of 44 tests passed.
running test/suite-temple.janet ...
test suite test/suite-temple.janet finished in 0.001 seconds - 8 of 8 tests passed.
running test/suite-test.janet ...
Hello world!
test suite test/suite-test.janet finished in 0.021 seconds - 240 of 240 tests passed.
running test/suite-utf8.janet ...
test suite test/suite-utf8.janet finished in 0.000 seconds - 33 of 33 tests passed.
running test/suite-zip.janet ...
test suite test/suite-zip.janet finished in 0.000 seconds - 1 of 1 tests passed.
✘ Failing test scripts: 1

This is on a Linux Mint machine FWIW.

@sogaiu
Copy link
Contributor

sogaiu commented Sep 16, 2025

FWIW, with bc1744c, both jpm test and janet-pm test gave no errors 👍

@bakpakin
Copy link
Member

bakpakin commented Oct 4, 2025

Looking to merge this, but is the issue with the missing /-i flag fixed, looked into? I mostly use windows 11 but breaking older version of windows is not tenable. Does the /-i flag break on older windows?

@pepe
Copy link
Member Author

pepe commented Oct 4, 2025

Unfortunately, I haven't found any simple solution. But in my opinion the current version will fail this PR's test, too. I may prepare new PR just with tests and see how it goes. I do not have access to any win 10 machine.

@pepe pepe mentioned this pull request Oct 7, 2025
@sogaiu
Copy link
Contributor

sogaiu commented Oct 7, 2025

Rereading this pr, still a bit confused.

The original post says:

added /-i switch, which turns off the prompt by the xcopy command

Looking at the output in this comment, I see:

/-I If destination does not exist and copying a single specified file,
assumes that destination must be a file.

Assuming that is basically the same as /-i, that doesn't seem like it's related to prompting...but may be it is?

Any idea what I am missing / misunderstanding?


Does the /Y that is already there not work in your environment?

The docs for it seem to suggest it might work:

/Y Suppresses prompting to confirm you want to overwrite an
existing destination file.

May be the docs are wrong or I'm again missing something 😅


Is there some code I might be able to reproduce:

I encountered this bug while trying to create the quickbin with spork/declare-cc, and it stuck.

with?

@sogaiu
Copy link
Contributor

sogaiu commented Oct 14, 2025

@pepe Do you have any thoughts about the comment immediately above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants