Odd question re linux & caches
lproven at gmail.com
Sun Sep 30 19:05:23 UTC 2012
On 30 September 2012 20:57, Gene Heskett <gheskett at wdtv.com> wrote:
> I was just bumfuzzled for several hours, here is the scenario:
> I have an old TRS-80 Color Computer 3 in the basement, hooked up to this
> box by 2 separate methods.
> One is a very high speed (for the coco) network over its bitbanger port at
> 115 kilobaud.
> Two is a shell (like bash) running on its hardware serial port, so I have a
> remote login that doesn't support any gfx commands.
> The first is called drivewire by its author and can access a file
> containing an image of one of the coco's disks.
> So, I 'touched' a file on this linux box, coupled to it by way of
> drivewire's mount facility, formatted this image as a disk, and then wrote
> a boot floppy image to it. I could unmount/eject it, and remount/insert it
> and all the data was still there.
> BUT, when I looked at it with linux 2 hours later with an ls -l, it was
> still a zero length file! I had to access it with hexedit to verify that
> the data was there & looked ok. After that, the proper file length of a
> bit over 161k was then shown by an ls -l.
> Is there some switch I can set which will cause linux to refresh its cache
> when a file has been opened, written to and closed again?
Standard Unix behaviour, AIUI. Has the happy side-effect that you can
delete a file and it won't actually go anywhere until all open file
handles to it are closed. This means that you can update the binaries
of a program and it will keep running quite happily. That is why you
can update your Linux box without rebooting it unless the kernel has
changed, so really, it is a good thing and it's not going to change.
It's the reason Linux needs so much fewer reboots than Windows does.
Liam Proven • Profile: http://lproven.livejournal.com/profile
Email: lproven at cix.co.uk • GMail/G+/Twitter/Flickr/Facebook: lproven
MSN: lproven at hotmail.com • Skype/AIM/Yahoo/LinkedIn: liamproven
Tel: +44 20-8685-0498 • Cell: +44 7939-087884
More information about the ubuntu-users