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

2005-11-21 Thread kuldeep vyas

  Hi Phillip,
  
  Thanks for information.
  While upgrading software (without reboot): this design technique is really 
good.
  But I've a doubt:-
When we purchase License of a software/tool, after expiry date: License 
Files
 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 
expired,
 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 <[EMAIL PROTECTED]> 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.  
___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: sort (textutils) 2.0.21 Bug

2005-11-21 Thread James Youngman
On Mon, Nov 21, 2005 at 10:56:16AM -0800, Mahesh Fernando wrote:
>   Dear friends,
>
>   I am using Windows service for unix 3.5. When I user the sort utility to 
> sort numerically for specific field it gives me error “Input file specified 
> two times.”.  I think it is a bug.

I'm pretty sure it's not.  Maybe you missed this result when you did a
web search to find the answer yourself before sending a bug report to
the mailing list, but you might well find it helpful to read this
article, which explains that this message isn't from GNU sort at all:

http://www.cygwin.com/ml/cygwin/2003-07/msg01696.html

Regards,
James.


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: sort (textutils) 2.0.21 Bug

2005-11-21 Thread Bob Proulx
Mahesh Fernando wrote:
>   I am using Windows service for unix 3.5. When I user the sort utility to 
> sort numerically for specific field it gives me error “Input file specified 
> two times.”.  I think it is a bug.
>   My command format as follows,
>
>   sort +23n file_name
>   sort utility version 2.0.21 
>
>   Could you please send me a solution for this bug?

Two things.  For one thing version 2.0.21 is very old.  Please
upgrade.  Secondly since you are using Windows we can't really help
too much here.  You would have much better luck with your question on
the cygwin mailing lists.

  http://www.cygwin.com

Mostly likely if you upgraded to the current coreutils available there
your problem would go away.

Bob


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


sort (textutils) 2.0.21 Bug

2005-11-21 Thread Mahesh Fernando
  Dear friends,
   
  I am using Windows service for unix 3.5. When I user the sort utility to sort 
numerically for specific field it gives me error “Input file specified two 
times.”.  I think it is a bug.
  My command format as follows,
   
  sort +23n file_name
  sort utility version 2.0.21 
   
  Could you please send me a solution for this bug?
   
  Thanks 
  Mahesh Fernando.
   



-
 Yahoo! FareChase - Search multiple travel sites in one click.  
___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


RE: Bug report: sort.c or AIX compiler

2005-11-21 Thread Lemley James - jlemle
Yes, -qlanglvl=extc89 fixes it so we are good to go.  Thanks.

-Original Message-
From: Paul Eggert [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 21, 2005 2:49 PM
To: Lemley James - jlemle
Cc: bug-coreutils@gnu.org
Subject: Re: FW: PMR 52061,370,000

"Lemley James - jlemle" <[EMAIL PROTECTED]> writes:

> I lost in my argument that they should do something about it; they are
> clearly not going to.

Thanks for trying.

Does -qlanglvl=extc99 and/or -qlanglvl=extc89 fix the problem?
If so, we're done, since my installed-on-Friday patch will use that.
If not, then I need to know what option(s) will fix the problem
without breaking something else.
***
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.



___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


RE: od command

2005-11-21 Thread Vance, Jack D.
od - --version = 2.0 written by Jim Meyering.
uname -a = Linux linux 2.4.29-rc1 #1 SMP Tue Jan 11 16:53:32 EST 2005 i686 
unknown unknown GNU/Linux
 
 
Jack

-Original Message- 
From: Eric Blake [mailto:[EMAIL PROTECTED] 
Sent: Fri 11/18/2005 4:03 PM 
To: Vance, Jack D.; bug-coreutils@gnu.org 
Cc: 
Subject: Re: od command



-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

In general, it is good to keep replies on the mailing list, so that they
will appear in archives for future reference.  Adding bug-coreutils back
to distribution.

According to Vance, Jack D. on 11/18/2005 1:49 PM:
> I almost understand except 000 and 1415102464 are decimal values 
not octal, because of the "-Ad" command option. Right?  I don't see the 
correlation between 1,415,102,464 and 10,005,037,056.

10005037056 modulo 2^32 is 1415102464, in other words, your version of 
od
used 32-bit math instead of 64-bit math.  Could you please report what 
'od
- --version' displays, as well as 'uname -a'?  If yours is not the most
recent version, try upgrading to coreutils 5.93 to see if it has been 
fixed.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDfkGO84KuGfSFAYARAhWnAJ0fUfu3av3HTY2ZnqUroMxQFMzm0QCfeouk
ndBjssfKRfpe7hoskEb8kJo=
=OpB5
-END PGP SIGNATURE-



___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: FW: PMR 52061,370,000

2005-11-21 Thread Paul Eggert
"Lemley James - jlemle" <[EMAIL PROTECTED]> writes:

> I lost in my argument that they should do something about it; they are
> clearly not going to.

Thanks for trying.

Does -qlanglvl=extc99 and/or -qlanglvl=extc89 fix the problem?
If so, we're done, since my installed-on-Friday patch will use that.
If not, then I need to know what option(s) will fix the problem
without breaking something else.


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


RE: Bug report: sort.c or AIX compiler

2005-11-21 Thread Lemley James - jlemle
Paul Eggert writes:
> The basic idea
> here is that coreutils will attempt to detect the problem, and pass
> the -qlanglvl=extc89 option to IBM's compiler.  (It will pass
> -qlanglvl=ansi to older versions of IBM's compilers.)  I assume this
> will work around the problem; if not, please let me know.

It does work the way you expect; this test is with _Bool as the datatype
for b. 

% cc -qlanglvl=extc89 test.c -o test
% ./test
d is 669
-2 + b is -1 (should be -1)
&d[-1] is 668
&c[4] is 668
&d[-2 + b] is 668
&d[-2 + b] == &c[4] (OK)


Thanks! 
*
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be
legally privileged.

If the reader of this message is not the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank you.
*


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


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

2005-11-21 Thread Philip Rowlands

On Mon, 21 Nov 2005, kuldeep vyas wrote:


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:-

[snip]


k>ls /home/k/
 // my_dir gone

k>pwd
/home/k/my_dir
 // oops!!


It's likely here that "pwd" is the shell's builtin version, rather than 
coreutils'.


Here what I see when calling /bin/pwd explicitly:

$ rmdir -v $(/bin/pwd)
rmdir: removing directory, /tmp/not-here
$ /bin/pwd
/bin/pwd: cannot get current directory: No such file or directory

I'd agree that this discrepancy between shell builtin and coreutil is 
somewhat confusing.



Cheers,
Phil


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


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

2005-11-21 Thread Phillip Susi
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:
   [input][input][input][input] 
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
  







___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


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

2005-11-21 Thread Andreas Schwab
kuldeep vyas <[EMAIL PROTECTED]> writes:

> k>pwd
> /home/k/my_dir
>   // oops!!

Try /bin/pwd.

> pwd says I'm in my_dir, but my_dir doesn't exist.

It does, it just doesn't have a name any more.

> 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.

There is nothing wrong with unlinking a file (of any type) that is still
in use.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


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

2005-11-21 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to kuldeep vyas on 11/21/2005 4:42 AM:
> 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;
...
> 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.

POSIX allows this behavior, but does not require it.  Basically, on
systems where it is legal to remove a directory that is in use, such as on
Linux, the directory continues to exist until all references to it (such
as processes that have it as the current working directory) have closed
their file descriptors, even though the directory is no longer accessible
from the file system.  On other platforms, such as cygwin, where removing
an in-use directory is forbidden by the OS, rmdir faithfully returns the
error 'Device or resource busy'.  It is a feature of Linux, and not a bug
in coreutils, that rmdir on Linux can remove an in-use directory; and
coreutils is just happy to provide the exact capabilities of the
underlying system in this case.

> 
> If my approach is not right, I'd like to know the 
> philosophy behind this.

You are welcome to try and patch the Linux kernel to have rmdir fail with
EBUSY if the directory is in use, but you will probably find that this
increases the complexity of the kernel and would be a tough sell to the
kernel crowd.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDgc/W84KuGfSFAYARAiIbAKCX/2SzbsWHbB/3DDBnQZGiVio/0wCfSQ4q
9Pw6xoNu9gBiM3o1shwxJRU=
=GbPm
-END PGP SIGNATURE-


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


can we remove a directory from within that directory??

2005-11-21 Thread kuldeep vyas
   [input][input][input][input] 
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.  
___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils