James G. Sack (jim) wrote:
>..> In one environment (f7 x86_64, ext3), it does an in-place change, as
> determined by comparing before/after stat output (inode is same). It's
> fast. an strace of my "shorten" perl script shows no file opens of the
> victim file.

Correction:
 The "no file opens" above is wrong
 I was looking at the wrong strace output, sorry.

Running my shorten script..
does an open (O_RDWR) of the target file
tries an ioctl which fails
  with -1 ENOTTY (Inappropriate ioctl for device)
followed by
 lseek, fstat, fctnl

 all the above is (I think) perl's implementation of the truncate call
 in terms of the ftruncate variation instead of the more direct
 truncate. Maybe perl knows something about platform/filesystem
 dependencies.

and finally, an ftruncate (followed by a close)

Regards,
..jim



-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to