in reply to polymorphic perl
Win98 is much like Unix1 here. If you delete a file while a process has it open, then the directory entry for the file is removed but the contents of the file (and the FAT2 or similar entries for the file) hang around until the last process to have the file open closes it.
Win98 is different from Unix in couple of ways that are related to this. First, when you open a file in Win98, you specify whether you want other processes to be able to read, write, and/or delete the file while you have it open. The "default"3 is to not allow any of this "sharing". But when using the C RTL4 (as Perl does) the default is to allow all sharing.
Secondly, Win98 doesn't support a file system that allows multiple directory entries per file5 (like most Unix file systems do). This is only tangentially related -- deleting a "hard link" for a file also doesn't delete the file contents just like deleting an open file doesn't.
1 Yes, I know it is officially "UNIX", but I just prefer "Unix" and always will. Tough noogies. q-:
2 File Allocation Table
3 I shy away from calling it a real default because you have to specify what type of sharing you want to allow, it is just much easier to specify no sharing (by specifying "0") than all sharing (by specifying FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE)
4 Run-Time Library
5 NTFS supports this, if in a rather awkward way
|
|---|