Re: "finally" for unit test



On Mar 23, 5:18 am, "killkolor" <gabriel.h...@xxxxxxxxx> wrote:
I have .. a single function that ..
works with files (takes input and outputs in the same file, no return
values).

That function could cause problems. If your function reads in the
whole file, modifies the data, and then overwrites the file, what
would happen if something unforeseen happened and your program crashed
after writing one line to the file? All the data in memory would go
poof! and your file would contain 1 line it--effectively erasing the
entire contents of the file.

.



Relevant Pages

  • Re: Back to Being a Luddite (Oh Well)
    ... We had letter writing where you embedded the ... viruses in emails. ... CD- recorder "helpers" that sit in your system tray consuming memory ... system tray apps don't consume cycles. ...
    (comp.dcom.telecom)
  • Proposal for a new algorithm for reading & writing a hibernation image.
    ... Some discussions with Rafael a while ago got me thinking about whether there might be a better way of writing a complete image of memory, particularly in the context of KMS breaking existing TuxOnIce algorithms. ... write protection for the page can be disabled and the write that caused the fault allowed to proceed. ... atomic restore as is done at the moment ...
    (Linux-Kernel)
  • Re: running Linux with no swap space (but lots of RAM)
    ... Some amount of caching is necessary to achieve such I/O scheduling. ... The amount of memory allocated to ... Someone who thinks writing to /dev/null would result in lots of data being ... TB of RAM and fits in an ATX case using no more than 550 watts of power. ...
    (comp.os.linux.development.system)
  • Re: Memory management and allocation
    ... > As I'm writing a piece of code that basically acts as a server and ... > memory management is a topic that is quite crucial. ... Or can I just allocate the variable ... Nor is it usually necessary to set the pointer to ...
    (comp.lang.c)
  • Re: Inner Demise?
    ... are seen by Buddhists as a gradual path to higher understanding and ... erasing, writing and erasing, writing and erasing a response, only to ... Matter is just an imagination within a sole ...
    (rec.music.classical.guitar)