pete@octopus.UUCP (Pete Holzmann) (12/17/85)
Thanks to all who responded to my request for help! Several had good clues that led me to the correct answer. Original problem: STAT shows two identically-named files in a directory. DIR and other directory commands don't. How did it happen? How to fix? Suggestions: 1. Don't trust STAT. (*WRONG* STAT was correct. DIR was wrong!) 2. There may be invisible garbage characters in one filename. (*WRONG, In this case* but that can happen, I know...) 3. Maybe STAT sees a 2-extent file as 2 files? (*WRONG*) 4. A file is in the current user and in the public (user 0) area. (*WRONG* - That isn't a problem on Molecular, nor on any CP/M I know of, other than maybe OSM) 5. There are 2 files. The CREATE call doesn't check for existing files first. (*RIGHT*... But see below!) SUMMARY: It is up to the programmer to delete any existing file before using the CP/M CREATE call. CREATE always makes a new directory entry. HOWEVER, in MP/M, no previous delete is needed- the CREATE call returns an error if the file already exists! It appears that CB-80 assumes you will run programs under MP/M, so it doesn't bother with the delete. On the Molecular, you can run in either CP/M mode or MP/M mode. In our case, it turned out that one user had the MP/M flag turned off, so they were the unknown source of duplicate filenames. NOTE that duplicate filenames are an unexpected thing in xP/M, and different programs treat them differently. For example: STAT - sees both files DIR - sees one file D - sees one file, adding size of both files to get 1 size PIP - tacks one on to the end of the other (PIP will recombine the files automatically... maybe it collects all of the extents before moving anything?) OPEN call - usually gets the first directory entry in the system. MORAL: Watch your CREATES and <C,M>P/M's! -- OOO __| ___ Peter Holzmann, Octopus Enterprises OOOOOOO___/ _______ USPS: 19611 La Mar Court, Cupertino, CA 95014 OOOOO \___/ UUCP: {hplabs!hpdsd,pyramid}!octopus!pete ___| \_____ Phone: 408/996-7746