Skip to content

Commit

Permalink
examples add
Browse files Browse the repository at this point in the history
  • Loading branch information
dvorakj31 committed Mar 4, 2019
1 parent 41a35e6 commit 85fe4e9
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.rst
Expand Up @@ -72,3 +72,40 @@ Windows system users
- Run command-line

- Run command ``py -3 -m pip install securefile-handler``


Examples
========

Example of shredding file::

import securefile_handler
securefile_handler.shred('/path/to/file')
securefile_handler.shred(Path('/path/to/another/file'))
securefile_handler.shred('/path/to/device')

You can change shred function arguments or whole erase function::

import securefile_handler
securefile_handler.shred('/path/to/file',
erase_function=lambda path: securefile_handler.erase_helpers.shred(path, chunk_size=1024 * 2))
securefile_handler.shred('/path/to/file', erase_function=my_better_function)

Module can securely remove files using shred function::

import securefile_handler
securefile_handler.remove_file('/path/to/file')
securefile_handler.remove_file('/symlink/is/destroyed/with/file/that/points/to')

There is possibility of removing non-empty directory trees aswell::

import securefile_handler
securefile_handler.remove_dirtree('/path/to/dirtree')
securefile_handler.remove_dirtree('/symlinks/in/dir/are/only/removed')

Moving files or directories is possible only between different devices::

import securefile_handler
securefile_handler.move_file('/file/on/disk1', '/destination/on/disk2')
securefile_handler.move_folder('/folder/on/disk1', '/destination_folder/on/disk2')

35 changes: 35 additions & 0 deletions docs/examples.rst
@@ -0,0 +1,35 @@
Examples
========

Example of shredding file::

import securefile_handler
securefile_handler.shred('/path/to/file')
securefile_handler.shred(Path('/path/to/another/file'))
securefile_handler.shred('/path/to/device')

You can change shred function arguments or whole erase function::

import securefile_handler
securefile_handler.shred('/path/to/file',
erase_function=lambda path: securefile_handler.erase_helpers.shred(path, chunk_size=1024 * 2))
securefile_handler.shred('/path/to/file', erase_function=my_better_function)

Module can securely remove files using shred function::

import securefile_handler
securefile_handler.remove_file('/path/to/file')
securefile_handler.remove_file('/symlink/is/destroyed/with/file/that/points/to')

There is possibility of removing non-empty directory trees aswell::

import securefile_handler
securefile_handler.remove_dirtree('/path/to/dirtree')
securefile_handler.remove_dirtree('/symlinks/in/dir/are/only/removed')

Moving files or directories is possible only between different devices::

import securefile_handler
securefile_handler.move_file('/file/on/disk1', '/destination/on/disk2')
securefile_handler.move_folder('/folder/on/disk1', '/destination_folder/on/disk2')

1 change: 1 addition & 0 deletions docs/index.rst
Expand Up @@ -13,3 +13,4 @@ Welcome to Secure File Handler's documentation!
introduction
installation
module
examples
4 changes: 4 additions & 0 deletions docs/introduction.rst
Expand Up @@ -2,3 +2,7 @@ Introduction
============

Module for secure (re)moving files and folders with content.

This module works on many platforms.

Tested on Windows 7, Windows 10, Arch Linux.

0 comments on commit 85fe4e9

Please sign in to comment.