Files
winsw/docs/deferred-file-operations.md
Next Turn dcf3013f75 Revise docs for 3.0.0-alpha.3 (#608)
* Mention optional settings

* Mention removed settings

* Add links to system requirements

* markdownlint fixes

* Remove trailing spaces

* Mention boolean elements

* Add preshutdown

* Add `dev ps` command

* Stop misleading

* Why aren't you using Windows 10?

* Add `stdoutPath`/`stderrPath`

* Relative paths and the default working directory

* Send a close message to Windows (GUI) apps

* Use valid XML

* Add `customize` and `dev kill` commands

* Update README.md

* Add commands

* Fix spacing

* Update installation.md

* Update README.md
2020-08-11 07:54:32 +08:00

23 lines
966 B
Markdown

# Deferred file operations
To support self updating services, winsw offers a mechanism to perform file operations before the process you specified in the configuration file gets launched.
This is often necessary because Windows prevents a file from being overwritten while it's in use.
To perform file operations, write a text file (in the UTF-8 encoding) at *myapp.copies*
(that is, it's in the same directory as *myapp.xml* and *myapp.exe* but with a different file extension),
and for each operation add one line:
* To move a file, write a line `src>dst`. If the `dst` file already exists it will be overwritten.
The success or failure of these operations will be recorded in the event log.
`src` and `dst` should be the full path to file, or you will see failed to copy file.
example:
```
c:\soft\sshd.exe.new>c:\bin\ssh.exe
```
The `<download>` element in the configuration file also provides an useful building block for a self updating service.