Everybody has heard of the phrase "be there or be square". So I thought it was time for a challenge about it.
Input
You will take a full absolute directory address as text as input via STDIN or equivalent.
Output
If the directory address exists and is valid, your program will move itself to that folder on your computer. If not, it will output via STDOUT or equivalent the following square:
+-+
| |
+-+
Requirements
- Standard loopholes are disallowed.
- You may output a single trailing newline if unavoidable.
- Your program must produce no output if it has been moved.
- Your program must be able to run again wherever it has been moved to.
Assumptions
- You may assume that the input is never empty.
- You may assume the directory never has a filename appended to the end.
- You may assume that the input directory is never the current one.
- You may assume you have permissions to write and execute everywhere.
This is code-golf, so shortest answer in bytes wins.
c:\users\Joe\program.txt
) or not (c:\users\Joe\
)? In the latter case, must the name of the created file be the same as the source? \$\endgroup\$