Skip to content

Missing filename quoting in Windows Batch #70

Description

@Tomalak

File existence checks should use quotes in Windows (when the filename uses spaces). Currently

if (exists("file 2.txt")) {
  println("file exists");
}

compiles to

if exist file 2.txt (
  echo file exists
)

but it should compile to

if exist "file 2.txt" (
  echo file exists.
)

In fact, quoting file names is never wrong, so simply doing it always won't break stuff.

Activity

changed the title [-]filname quoting in Windws Batch[/-] [+]Missing filename quoting in Windws Batch[/+] on Jul 20, 2018
changed the title [-]Missing filename quoting in Windws Batch[/-] [+]Missing filename quoting in Windows Batch[/+] on Jul 20, 2018

Tomalak commented on Jul 20, 2018

@Tomalak
Author

damn, two typos in the title, that's a sad record...

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

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