File and Directory Names become hidden

Something very weird has been happening when I'm creating files and directories. When I create a directory, at times depending on the directory name and depth, it becomes hidden and can only be seen typing "ls -a". When I say the name of the directory matters, "my_c++" will be hidden but using the name "testdir" will be fine. Even more puzzling is the problem when I'm creating files. Again it depends on the name. A file name "dat052302" is okay, but "dat052302.dos" becomes hidden, and "ls -a" or "ls -l" doesn't show the existing file. So when I type "ls" to list the contents of the directory, the new file is not in the list. This happens when I create the file using an editor, a c++ program, and by copying from another file! For example, if I copy a file that is not hidden, the destination file becomes hidden, so "cp dat052302 dat052302.dos" will create the "dat052302.dos" file but it will be hidden.

I'm using Sun Solaris 8, Ultra 10.

If anyone has encountered a similar problem or might know how to fix this, PLEASE let me know, I would greatly appreciate it.

Thanks

The only files you shouldn't see is something starting with .filename when you do a ls -l.

Use the alias command to see if the ls command is aliased in a way which would 'hide' the files that you should still be seeing or do the following:

/usr/bin/ls -l

If you see all the files, then it is either an alias or how your path is set. You can double check with 'which ls'

The directories where these files and subdirectories are becoming "hidden" I created myself, so there are no ".filename" files. I also double checked to make sure that the ls command is /usr/bin is not aliased. Doesn't "ls -a" display hidden files anyway? These files still don't appear in the list when I type "ls -a".

And the output of $ which ls
give you /usr/bin/ls ?

Having $ ls -a not show the files, I would believe that may be the problem. Also check your umask (although that is a long shot that it would be screwed up). The directories you are coping into are owned by you? Post the permissions of the directory where this has happened along with your umask, please.

Below is an example of what's happening. The first 2 commands display the umask output and directory permissions. Afterwards is an example of what's happening. There is only one file in the "project 3" directory, called "bko.fnl". I copy the this file to a new file called "bko.dos". The file is created but is "hidden" when using the "ls" command, and the contents can be viewed with the "more" command. It can also be removed. But when the new file has the name "testfile" it's not "hidden" and can be seen using "ls". I should also note that I can see the "bko.dos" file when I'm using the desktop file manager.

user55@gamera> umask
0022
user55@gamera> ls -la
total 14
total 14
drwxr-xr-x 7 user55 staff 512 May 22 17:05 .
drwxr-xr-x 5 user55 staff 048 May 23 14:38 ..
drwxr-xr-x 2 user55 staff 1024 May 23 14:38 project3
drwxr-xr-x 2 user55 staff 3072 May 23 12:09 project4
user55@gamera> cd project3
user55@gamera> ls -la
total 4
total 4
drwxr-xr-x 2 user55 staff 512 May 23 14:42 .
drwxr-xr-x 7 user55 staff 512 May 22 17:05 ..
-rw-r--r-- 1 user55 staff 32 May 23 14:42 bko.fnl
user55@gamera> more bko.fnl
Test file, contents of bko.fnl.
user55@gamera> cp bko.fnl bko.dos
user55@gamera> ls -la
total 4
total 4
drwxr-xr-x 2 user55 staff 512 May 23 14:42 .
drwxr-xr-x 7 user55 staff 512 May 22 17:05 ..
-rw-r--r-- 1 user55 staff 32 May 23 14:42 bko.fnl
user55@gamera> more bko.dos
Test file, contents of bko.fnl.
user55@gamera> rm bko.dos
user55@gamera> cp bko.fnl testfilename
user55@gamera> ls -la
total 4
total 4
drwxr-xr-x 2 user55 staff 512 May 23 14:51 .
drwxr-xr-x 7 user55 staff 512 May 22 17:05 ..
-rw-r--r-- 1 user55 staff 32 May 23 14:42 bko.fnl
-rw-r--r-- 1 user55 staff 32 May 23 14:51 testfilename
user55@gamera> more testfilename
Test file, contents of bko.fnl.
user55@gamera>

ls should not be displaying the total line twice like that. I do not believe that you are using a standard version of ls. Repeat your experiment, but whereever you would type "ls", instead type "/usr/bin/ls".

Also what shell are you using? What do you get when type "whence ls"? Also "which ls"?

On SunOS 5.8, when I type "cksum /usr/bin/ls" I get "169775630 18844 /usr/bin/ls". What do you get?

user55@gamera> ps
PID TTY TIME CMD
549 pts/5 0:00 sh
7942 pts/5 0:00 ps
user55@gamera> whence ls
whence: not found
user55@gamera> which ls
/bin/ls
user55@gamera> /usr/bin/ls -l
total 2
total 2
-rw-r--r-- 1 user55 staff 32 May 23 14:42 bko.fnl
user55@gamera> /usr/bin/ls
bko.fnl
user55@gamera> cksum /usr/bin/ls
2980984376 18844 /usr/bin/ls
user55@gamera> uname -a
SunOS gamera 5.8 Generic_111433-02 sun4u sparc SUNW,Ultra-5_10
user55@gamera> /usr/bin/ls -la
total 2
total 2
drwxr-xr-x 2 user55 staff 512 May 23 15:22 .
drwxr-xr-x 7 user55 staff 512 May 22 17:05 ..
-rw-r--r-- 1 user55 staff 32 May 23 14:42 bko.fnl
user55@gamera> more bko.fnl
Test file, contents of bko.fnl.
user55@gamera> more bko.dos
bko.dos: No such file or directory
user55@gamera> cp bko.fnl bko.dos
user55@gamera> /usr/bin/ls -la
total 4
total 4
drwxr-xr-x 2 user55 staff 512 May 23 15:38 .
drwxr-xr-x 7 user55 staff 512 May 22 17:05 ..
-rw-r--r-- 1 user55 staff 32 May 23 14:42 bko.fnl
user55@gamera> more bko.dos
Test file, contents of bko.fnl.
user55@gamera> rm bko.dos
user55@gamera> cp bko.fnl testFileName
user55@gamera> /usr/bin/ls -la
total 4
total 4
drwxr-xr-x 2 user55 staff 512 May 23 15:38 .
drwxr-xr-x 7 user55 staff 512 May 22 17:05 ..
-rw-r--r-- 1 user55 staff 32 May 23 14:42 bko.fnl
-rw-r--r-- 1 user55 staff 32 May 23 15:38 testFileName
user55@gamera> more testFileName
Test file, contents of bko.fnl.
user55@gamera>

Could this be a terminal i/o issue of some kind? Try "ls -l > file" and vi the file. Or even better, "ls -l | mailx someaddress" and mail it to another system for inspection.

Another thing to try is:
env - /usr/bin/ksh
ls -l
exit

The first command discard the entire environment and runs a subshell with any envirorment at all. Then the second command is just an "ls -l" being run by a shell that saw an environment. It that worked type "env" and post the results.

I was reading your post and noticed the rev level of the OS (111433-02).

Possible that the level could be part of the problem as that original patch should not be on the system. It was replaced by 108528-09. Following from SunSolve:

The fix(es) delivered by Supplemental Patch 111433-02 has
been integrated into patch 108528-09.

Please install patch 108528-09 to revolve the bug(s) described
in this patch.

If 111433-02 is releady installed on your system, it is necessary
to back out 111433-02 before installing patch 108528-09.

********************************************************************

NOTE: The fixes in this point patch are scheduled to be integrated
in the next Solaris 8 kernel update patch 108528-09.
NOTE: This patch may contain one or more OEM-specific platform ports.
See the appropriate OEM_NOTES file within the patch for
information specific to these platforms.
DO NOT INSTALL this patch on an OEM system if a corresponding
OEM_NOTES file is not present (or is present, but instructs not
to install the patch), unless the OEM vendor directs otherwise.
NOTE: Refer to Special Install Instructions section for IMPORTANT
specific information on this patch.

Just in case anyone is curious, Sun Support has resolved my problem. Somehow the "ls" binary file had become corrupted. So all I had to do was copy the "ls" binary file from another machine running solaris 8 and place in my /usr/bin directory. Although, I was told this was potentially dangerous, it was also a quick fix. Thanks everyone for you help!