On Mon, Mar 03, 2008 at 05:21:47PM +0000, Smylers wrote:

>   $ man chattr
>   No manual entry for chattr
> 
>   $ man lsattr
>   No manual entry for lsattr
> 
> That's on a FreeBSD server.  Let's try Linux.  Ah, yes:
> 
>   $ whatis chattr
>   chattr (1)           - change file attributes on a Linux second
>   extended file system
> 
> So you can make this test work even when running as root, so long as you
> don't mind it now failing on Unix-like OSes that aren't Linux.  I'm not
> sure that's a nett win!

Well, it depends on whether the file system supports chattr... :-)

The FreeBSD equivalent:

$ cd /tmp/
$ date >Pie
$ chflags uchg Pie
$ date >Pie
bash: Pie: Operation not permitted
$ cd ~/test
$ date >Pie
$ chflags uchg Pie
chflags: Pie: Operation not supported
$ df .
Filesystem 1K-blocks      Used    Avail Capacity  Mounted on
nas:/data  258199522 203419366 34124196    86%    /filer

Nicholas Clark

Reply via email to