Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • erase file error when confirm file and save file work

    Trying to confirm whether a file exists, and erase it if it does exist. Can't seem to figure out how to do this with a Windows path with spaces. Here's my MWE:

    Code:
    webuse auto
    local pathname `c(pwd)'
    save "`pathname'\erasetest.dta", replace
    confirm file "`pathname'\erasetest.dta"
    erase file "`pathname'\erasetest.dta"
    The erase command produces this error
    Code:
    invalid '"C:[path]\erasetest.dta'

  • #2
    erase has no subcommand file. See

    Code:
    help erase

    Comment


    • #3
      Well, that's embarrassing. Thanks!

      Comment

      Working...
      X