[pedevel] Re: "Bug" with files on a Samba share

  • From: Oliver Tappe <pedevel@xxxxxxxxxxxxxxx>
  • To: pedevel@xxxxxxxxxxxxx
  • Date: Mon, 22 Mar 2004 16:29:38 +0100

Hi there,

On 2004-03-22 at 09:21:36 [+0100], BiPolar wrote:
> > > Another thing here is, should the change the way the temporary backup 
> > > is made from rename-write to duplicate-overwrite:
> > > pro:  the icon would stay on the same place in Tracker con:  it would 
> > > double the time to save a file
> > > Perhaps this could be solved by restoring the Tracker position 
> > > attributes
> > 
> > Hm, this might prove pretty hard, since there may be a race condition 
> > between Pe and Tracker's node monitor to write these attributes.
> 
> Well, actually Pe does not always plays nicely with file's attributes. 
> Try this to see what I mean:
> 
> - Grab any text file and add an Icon attribute to it.
>   (I did that for a couple of "Install.sh"/"Uninstall.sh" scripts).
> - Open the file in Pe, change something, save, close.
>   Go to Tracker to see how the icon got corrupted (the 32x32 one, the 
>   smaller looks ok).
> 
>  Here, the 32x32 Icon attribute gets overriten with FF's and shrinked to 
>  24 bytes long (both QuickRes and OBOS DiskProbe report that).
> 
> This could be the old issue of attributes not fitting within the BFS 
> block (mine is 2048), but the fact that this happens even when the 
> "pe_info" attribute was already there makes me think its Pe's fault.

This was an issue with Pe trying to use an offset>0 with WriteAttr(), which 
doesn't work at all (the attribute gets overwritten instead). The reason 
why there were only 24 bytes in the icon-attribute left is because Pe was 
copying attribute-contents in 1000 bytes-pieces. The icon-attribute is 1024 
bytes long, so the second write clobbers the first 1000 bytes and replaces 
them with just 24.

This is fixed now.

cheers,
        Oliver

Other related posts: