Skip to main content

write safer, sftp

Project description

sftpovw: safer overwrite file over sftp

protect against corruption:

  • old file: data lost if overwrite fails
  • new file: partial write may leave corrupt/incomplete file
  • readers: processes opening the file may observe unspecified/intermediate data

when PUT localfile to remotefile,

safe level 0

protect nothing

  1. just put localfile to remotefile

safe level 1

protect readers

  1. unlink remotefile
  2. put localfile to remotefile

safe level 2

protect old file and readers

  1. rename remotefile to tmpfile
  2. put localfile to remotefile
  3. unlink tmpfile

safe level 3

protect new file, old file, and readers

  1. put localfile to tmpfile
  2. rename tmpfile to remotefile

safe level 4

protect new file, old file, and readers

usually this level is unnecessary. should only be used if your rename is not atomic.

  1. put localfile to tmpfile1
  2. rename remotefile to tmpfile2
  3. rename tmpfile1 to remotefile
  4. unlink tmpfile2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sftpovw-0.1.dev1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file sftpovw-0.1.dev1-py3-none-any.whl.

File metadata

  • Download URL: sftpovw-0.1.dev1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for sftpovw-0.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9e4b208e81944ecbd7fca95bd0b4b70b95f4a4f0c6cf6aa531769c59be3c90e
MD5 139cff19b8bfbf02ccf639c706763bbd
BLAKE2b-256 518eb56b27072ae093b38cebdc86e75c81c5024b2c9087c7e9ff66df97e8dc92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page