file primitive test suite

Stephan Rudlof sr at evolgo.de
Tue Nov 20 01:58:10 UTC 2001


John M McIntosh wrote:
> 
> >  > Yes, you can delete an open file on a Unix system. The file is not
> >>  really deleted, but its name is removed from a directory. When
> >>  all open references to the file go away, then the file is really
> >>  deleted. This is analogous to an object which does not get garbage
> >>  collected until all references to the object are gone.
> >
> >And it is common practice to do this when creating temporary files
> >on Unix.  If your application crashes (or is killed), you don't leave
> >breadcrumbs on the floor.
> >
> >-david
> 
> Thank I kinda knew that was the case, since evil things like rm -rf / exist.
> 
> 2nd any windows users (and linux) folks run the tests? Would be nice
> to know if they did work on those platforms?
> 

> Bigger question do we want to 'fix' delete to forbid delete if the
> file is open to preserve how things work in squeak across platform.

Could work, if it´d be possible for all platforms to check for openess of
files performed by other applications.
Any platforms where this doesn´t work?

> Or perhaps we close the file if it is open, then delete it. Thoughts
> anyone?

What about other applications with handles to this file?
This approach seems to work platform independent just with Squeak only
controlled files. (´Squeak only´ means *one* running Squeak here).


The former limits the capabilities for closing files, the latter needs
preconditions for the files (Squeak only controlled).

I prefer the former since
- it would be platform independent;
- forced remove of Squeak only controlled files should be handable inside
Squeak;
- removing a Squeak only controlled open file sounds like an implementation
error;
- if other applications don´t close and remove their files, it´s their
fault.

But what about two Squeaks working with the same file? Hmm, which closes
last should remove it then.

Too idealistic?


Greetings,

Stephan



> 
> The purpose of doing these primitive test suites is to catch platform
> dependent behavior, then the questions is how to fix, or if we should
> fix to preserve the same behavior across systems.
> 
> --
> --
> ===========================================================================
> John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3




More information about the Squeak-dev mailing list