Giter VIP home page Giter VIP logo

exercise2's Introduction

Shred

Usage:

`Shred("yourfilename")`

Testing:

Run `make run` or `bash create_test_files.sh` followed by `go test`

Note: test files are created outside the go tests to allow the memory consumption of the go tests to be profile easier without being influenced by memory used during the creation of test cases

Configuration:
 - ENABLE_LOGGING can be changed within shred.go

Test cases handled:
 - handles cases where the file does not exist
 - throws an error when the file cannot be written to
 - handles both text and binary formats
 - handles files of varying sizes
 - deletes the file after shredding
 - ensures file contents before deletion is different to the original contents
 - records memory usage to check that it is capped (i.e. shredding 100MB file does not use 100MB of memory)
 - checking for open file handles after completion
 - empty files

Test cases not handled:
 - behaviour with "non-standard" files, such as virtual filesystems, network drives, devices, etc.
 - low memory devices (although basic memory usage tracked)
 - simulating devices low on storage and handling "No space left on device" errors
 - checking file size is same before deleting
 - checking no subcontents of original file are found in contents before deleting

exercise2's People

Contributors

pwithams avatar

Watchers

Patrick Withams avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.