I propose to add a new switch -p
for the command /write
, which should help to automatically create a directory from the specified path to the file, before a new line of text is written to it. If the directory already exists, then a normal write is performed as if this switch had not been specified.
At the moment, if the directory is missing it returns the error "* /write: unable to open file", after which it is necessary to create the directory manually or with the command /mkdir
, which is not always convenient and understandable for a beginner. My idea should help simplify this problem, so that you can simply add a switch to the command /write -p
.
Syntax: /write [-p] <filename> [text]
Example: /write -p newdir\folder\file.txt New line text 1