[Bug 1019316] Re: ls gives incorrect directory listing
jan5000
1019316 at bugs.launchpad.net
Sat Jun 30 16:15:40 UTC 2012
Thanks for that. Interesting.
I have a script (called "clean") which manually removes some of my application directories and their contents (i.e. the EXPORT directory, and subdirectories) , and I have a program (which I wrote) which when it starts will recreate a new EXPORT directory, and subdirectories if they don't exist. Depending on whether you run ls from a new terminal or one which has been around for a while, and depending on when you run the clean script or program, you sometimes get unexpected results in terms of directory listings in terminal windows which don't reflect what actually happened in the directory moments before.
I must admit I am concious of not trusting (a bit strong, I apologise)
ls (when I am developing my application), unless I either bounce to the
parent and back again (i.e. as per my report ), or I cd to it from a new
terminal. It's very difficult to explain because it's inconsistent. But
I see from your example you've illustrated similar ls behaviour.
Can you explain: "This is expected, and not an error". You would have
thought that all termnials (and ls running on each termianl) would keep
"in sync" with any changes to the directory which may occur from other
terminals or indeed (in my case) other programs or scripts, and report
the "truth", As a "Windows lover" said to me yesterday (tongue in cheek)
"That wouldn't have happened on Windows 7". Sadly (as a Linux
application developer / Windows 7 (when I have to) user) I did not have
any defence to offer...
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/1019316
Title:
ls gives incorrect directory listing
Status in “coreutils” package in Ubuntu:
Incomplete
Bug description:
/* At this point I am expecting some files in /TEST/EXPORT, want to see them in received order... */
ubuntu at test-0001:~/TEST/EXPORT$ ls -ltr
total 0
/* None???!!! what? */
ubuntu at test-0001:~/TEST/EXPORT$ ls
/* Huh? - seen this many times now...I know the trick to making it
work...*/
ubuntu at test-0001:~/TEST/EXPORT$ cd ..
ubuntu at test-0001:~/TEST$ cd EXPORT
ubuntu at test-0001:~/TEST/EXPORT$ ls -ltr
total 32
-rw-rw-r-- 1 ubuntu ubuntu 241 Jun 29 15:51 AA_TEST000002_20120629145129_abcde_efghi_20120629145127.kkk
-rw-rw-r-- 1 ubuntu ubuntu 20 Jun 29 16:03 AA_TEST000002_20120629150314_xyz
-rw-rw-r-- 1 ubuntu ubuntu 242 Jun 29 16:06 AA_ABC1234568_20120629150615_abcde_efghi_20050101120218.kkk
-rw-rw-r-- 1 ubuntu ubuntu 20 Jun 29 16:06 AA_TEST000002_20120629150643_xyz
-rw-rw-r-- 1 ubuntu ubuntu 20 Jun 29 16:10 AA_TEST000002_20120629151012_xyz
-rw-rw-r-- 1 ubuntu ubuntu 20 Jun 29 16:13 AA_TEST000002_20120629151342_xyz
-rw-rw-r-- 1 ubuntu ubuntu 20 Jun 29 16:17 AA_ABC1234568_20120629151707_xyz
-rw-rw-r-- 1 ubuntu ubuntu 20 Jun 29 16:17 AA_TEST000002_20120629151711_xyz
/* That's more like it!!! */
ubuntu at test-0001:~/TEST/EXPORT$ ls --version
ls (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard M. Stallman and David MacKenzie.
ubuntu at test-0001:~/TEST/EXPORT$ lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1019316/+subscriptions
More information about the foundations-bugs
mailing list