[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can we remove a directory from within that directory??

From: kuldeep vyas
Subject: Re: can we remove a directory from within that directory??
Date: Mon, 21 Nov 2005 22:45:08 -0800 (PST)

  Hi Phillip,
  Thanks for information.
  While upgrading software (without reboot): this design technique is really 
  But I've a doubt:-
    When we purchase License of a software/tool, after expiry date: License 
     1. are deleted, OR
     2. are modified so that they can't be used further, OR
     3. use date & time of the computer(on which they are running) to get 
     et al.
  Some softwares & tools can still be used even after expiry date,  because 
they had started running before expiry date & never closed  & hence still 
running even after expiry date. License files which  are in the directory tree: 
come into picture when software/tool is  started.
  Most of the softwares & tools are robust enough in design to handle this but 
some are still vulnerable.
    I wonder whether Operating System provides some option to ensure that:
    a file which is modified in the directory-tree must be accordingly  & 
instantly updated in all forms of memory(RAM, cache etc.)
  I mean whatever is running in the system should not be keep on running  once 
it's modified to stop & we shouldn't have to wait for next  open.
 Happy contributing to LINUX!!
  kuldeep vyas
Phillip Susi <address@hidden> wrote:  It is a general design philosophy of 
linux, and unix in general, that 
the kernel will not enforce locking of files.  This is why you can 
upgrade software without rebooting: the old file can be deleted and 
replaced with the new file, even though it is still in use.  Of course, 
it isn't actually deleted until everyone using it closes it, but it's 
name is removed from the directory tree immediately.

If you really want to mess up a system, you can rm -fr / ( as root of 
course ) and it will happily delete all the files on the system. 
Whatever is running at the time will keep running, but new opens will 
fail.  This behavior is pretty much by design.

kuldeep vyas wrote:
> Hi,
> I'm using Redhat 9 (kernel 2.4.20-8 on i686)
> I logged in as k(username), then I started terminal, &
> then I gave following commands:-
> k>pwd
> /home/k
> k>mkdir my_dir
>   // i created a directory: my_dir
> k>cd my_dir
>   // let's go in my_dir
>   // now let's try to remove my_dir
> k>rmdir /home/k/my_dir
>   // no error;
> k>ls /home/k/
>   // my_dir gone 
> k>pwd
> /home/k/my_dir
>   // oops!!
>   // let's create my_file here!!
> k>cat >my_file
> bash: my_file: no such file or directory
>   // I'm not allowed to a create file here.
> pwd says I'm in my_dir, but my_dir doesn't exist.
> I think: user should not be allowed to remove a directory,
> until & unless he is placed in a directory which is 
> hierarchically above the one he has chosen to remove.
> If my approach is not right, I'd like to know the 
> philosophy behind this.
> Happy contributing to LINUX!!
> kuldeep vyas

 Yahoo! FareChase - Search multiple travel sites in one click.  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]