Examining the file count in Dolphin produced in some directories that should be equal in fact are off by one.
It’s not immediately obvious why this is, but if I do a “ls -a” to show hidden files I sometimes get a list that starts
.
…
This is as it should be, a pointer to itself and a pointer to the parent.
In those directories that are off by one, the ls -a produces
.
…
.directory
The count appears to be different in that it is counting “.directory” as a file where . and … are not counted as files. I’m pretty sure I did not deliberately create the .directory entry, but I guess I must have done something different to make it appear.
Anybody know what is happening here? Googling for stuff with punctuation in it is a pain to say the least.
If you look at the contents of a typical .directory, it’s obviously to do with the GUI desktop. I would guess Dolphin is deliberately excluding them from the count.
These files are generated by Dolphin itself AFAIK. If you take a look at the file:
glosscomputer@Knurpht:~> more .directory
[Dolphin]
AdditionalInfo=259
AdditionalInfoV2=Icons_Size,Icons_Permissions,Icons_Owner
ShowPreview=true
Timestamp=2011,1,5,23,30,11
Version=2
It’s just a plain text file, and should be counted as a file.
Thankyou guys, you are correct.
I was assuming that the .directory was a special non file pointer so I did not think I could look inside it.
As you say it is created by Dolphin, which does this in order to record anything special about the way the contents of the dir should be displayed. In one case I had specially requested that permissions be shown. Indeed it should be counted as a file, and the count is therefore correct.
Don’t infer anything from the name, look at the type of the filesystem object in the output of ls -l. It’s a directory for dolphin but it’s a plain file where the OS is concerned.