How to disable creating .directory files?

I’m using openSUSE 11.4 (x86_64) with KDE: 4.6.00 (4.6.0) “release 6”

Everytime I visit a direcotory, a hidden file “.directory” is created. How to disable that? Is There a possibility to disable that behaviour only for public_html directory?

Thanks for any help.

On 05/30/2011 09:36 AM, michalsrodek wrote:
>
> I’m using openSUSE 11.4 (x86_64) with KDE: 4.6.00 (4.6.0) “release 6”
>
> Everytime I visit a direcotory, a hidden file “.directory” is created…

welcome new forum poster!

how are you “visiting” a directory? that is, what tool or program are
you using to ‘visit’?

and, who are you (a user, or root) when you “visit”.

where is this “public_html directory”? is it on your local machine or
are you accessing a distant server via some tool/program?

this doesn’t sound like an openSUSE problem…


dd CAVEAT: http://is.gd/bpoMD
[NNTP via openSUSE 11.4 [2.6.37.6-0.5] + KDE 4.6.0 + Thunderbird 3.1.10]
Dual booting with Sluggish Loser7 on Acer Aspire One D255

All directories have a hidden file .directory - in some ways like the … you see in Windows. If you uncheck View Hidden files, you won’t see them.

Thta’s a good explanation, but I doubt it is what the OP is after. He may, or may not, understand what they a re for, but he simply wants them not to be created, at least in a specific directory called public_html. (Please @michalsrodek, can you confirm my diagnoses?).

AFAIK in KDE these files are created by Dolphin (at least I find one:


henk@boven:~> cat .directory
[Dolphin]
AdditionalInfo=63
Timestamp=2010,3,1,10,21,10
ViewMode=1
henk@boven:~>

Thus looking hrough Dolphin configuration possibilities might reveal something. But them being an integrated part of the Desktop I doubt you can prevent their creation. OTOH deleting them does not much harm IMHO…

Not using Dolphin on public_html might not be a real solution to the OP. But the OP could elaborate a bit on why he thinks these small files are a nuisance.

john hudson wrote:

>
> All directories have a hidden file .directory
Sorry, that is simply not true. It is a file created by the file browser
which contains information on howto view the folder in which you are.
This file does not exist in folders which you never opened with for example
konqueror or dolphin (I do not know what nautilus does).


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.3 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.0 | nVidia
ION | 3GB Ram

@hcvv: your diagnoses is right. I create a zip package from time to time and .directory files are inside.

I wrote a small script for clean up but it’s not a handy solution

#!/bin/sh
rm -rvf find . -type f -name .directory

I’m using Dolphin. My public_html is located in my home directory: /home/michal/public_html

Thanks for answers! I’ll try to check Dolphin configuration.

You are not obliged to answer all the questions we ask in turn, but when we have to help you as good as possible with your problem, I think we should know what your real problem is. As asked above: what is it you have against this file being there? It will be in every directory that you visit with Dolphin (or Konqueror) and everybody using these file managers have them in ost of their directories without ever complaining. What is your rproblem? When we know that we might be able to atack the real problem instead of what you think might be your solution to that real problem.

On 2011-05-30 11:06, hcvv wrote:
> Not using Dolphin on -public_html- might not be a real solution to the
> OP. But the OP could elaborate a bit on why he thinks these small files
> are a nuisance.

The public_html directory is exported by apache, so visitors can see it,
and its contents. Dunno about hidden directories. Perhaps adding the
appropiate access file in that directory would block apache from serving it.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Hi
You say you are using zip? If so run from the command line and exclude
the .directory file with the -x option?


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.5-desktop
up 4 days 18:58, 3 users, load average: 0.08, 0.07, 0.05
GPU GeForce 8600 GTS Silent - Driver Version: 270.41.19

The public_html directory is exported by apache, so visitors can see it,
and its contents. Dunno about hidden directories. Perhaps adding the
appropiate access file in that directory would block apache from serving it.

I hope Apache does not do something like that by default :frowning:

In any case when you do not have Directory Listing on, Apache will not show that it exists. Which will not prevent a browser user from asking for it in an URL, but why should she/he do that? And What to learn from it?

And of course, when you have certain files within an Apache served part of the tree, you do not want to serve, you better configure Apache not to do so.

But all is speculation as the OP did not state that this directory is subject to Apache serving.

I think it’s not apache’s problem because I have .directory files also in other places. I just need to disable creating .directory files. I think, Dophin creates them.

@malcolmlewis: I could use -x but it’s not the solution. Somethimes I just copy, a folder without packaging it to my pendrive etc etc…

@hcvv: “what is it you have against this file being there” - I zip some folders from my public_html and send them to my clients. Packages should not contain any unwanted files because it’s not proffessional(most of my clients use Windows). In other hand my packages have to contain some other hidden files(e.g. .htaccess).

On 05/30/2011 06:36 PM, michalsrodek wrote:

> Packages should
> not contain any unwanted files because it’s not proffessional

so, delete then zip…

or exclude the file like this:


zip zip -r foo foo -x \.directory

or make a script to do that for you…

or don’t use Dolphin–because as far as i know there is no way to
disable that “feature”…hmmm, you could download the code, rewrite it
to please you, compile and you are good to go.


dd CAVEAT: http://is.gd/bpoMD
[NNTP via openSUSE 11.4 [2.6.37.6-0.5] + KDE 4.6.0 + Thunderbird 3.1.10]
Dual booting with Sluggish Loser7 on Acer Aspire One D255

On 05/30/2011 08:36 AM, michalsrodek wrote:
>
> I think it’s not apache’s problem because I have .directory files also
> in other places. I just need to disable creating .directory files. I
> think, Dophin creates them.
>
> @malcolmlewis: I could use -x but it’s not the solution. Somethimes I
> just copy, a folder without packaging it to my pendrive etc etc…
>
> @hcvv: “what is it you have against this file being there” - I zip some
> folders from my public_html and send them to my clients. Packages should
> not contain any unwanted files because it’s not proffessional(most of my
> clients use Windows). In other hand my packages have to contain some
> other hidden files(e.g. .htaccess).

If it was me, I’d just browse to the directory with the files I want to
zip, hold down the control key and click on each that I want to include
and then right click on the and select compress from the menu. It
should create an archive with just the files you’ve selected.

…Kevin

Kevin Miller - http://www.alaska.net/~atftb
Juneau, Alaska
In a recent survey, 7 out of 10 hard drives preferred Linux
Registered Linux User No: 307357, http://counter.li.org

On 2011-05-30 17:06, hcvv wrote:
>
>> The public_html directory is exported by apache, so visitors can see it,
>> and its contents. Dunno about hidden directories. Perhaps adding the
>> appropiate access file in that directory would block apache from
>> serving it.
> I hope Apache does not do something like that by default :frowning:

Of course it does :slight_smile:

/etc/httpd/suse_public_html.conf:

<IfModule mod_userdir.c>

Note that the name of the user directory (“public_html”) cannot easily be

changed here, since it is a compile time setting. The apache package

would have to be rebuilt. You could work around by deleting

/usr/sbin/suexec, but then all scripts from the directories would be

executed with the UID of the webserver.

UserDir public_html
</IfModule>

<Directory /home/*/public_html>

It is configured so that the users of SUSE machine can have their own
little web page at home or business, directly inside their own home
directory. And YaST dutifuly creates that directory on all new users.

It would respond to <http://localhost/~username>, displaying the web page
the user creates there.

> In any case when you do not have Directory Listing on, Apache will not
> show that it exists. Which will not prevent a browser user from asking
> for it in an URL, but why should she/he do that? And What to learn from
> it?

No, it is not directory listing.

> But all is speculation as the OP did not state that this directory is
> subject to Apache serving.

That is the intent of the ~/public_html directory. Using it for something
else is a mistake.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

On Mon, 30 May 2011 07:36:03 GMT michalsrodek wrote:

> Everytime I visit a direcotory, a hidden file “.directory” is created.
> How to disable that? Is There a possibility to disable that behaviour
> only for public_html directory?

I have this file only for directories where i want to have another
icon that the default one. In the preferences of dolphin you can choose
that all directories should be open with the same view and than it is
not necessary to remember the view of every visited directory.

See you, Attila

On 2011-05-30 11:06, hcvv wrote:
> Thus looking hrough Dolphin configuration possibilities might reveal
> something. But them being an integrated part of the Desktop I doubt you
> can prevent their creation. OTOH deleting them does not much harm IMHO…

I don’t think that creating that directory on all directories it reads is
nice. Like when you borrow a usb stick from somebody (a windows user!) and
later he phones you to ask why did you write that rubish on all /his/
directories.

If I remember correctly, the windows explorer does something similar when
you select view directory as webpage or you somehow customize the display
of a directory. I think I read somewhere (gnome? kde?) that the info could
instead be stored on a central file outside of each directory you visit.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

On 05/30/2011 09:33 PM, Carlos E. R. wrote:

> I don’t think that creating that directory on all directories it reads is
> nice.

it is not creating a directory, instead it is creating a file named
…directory

> If I remember correctly, the windows explorer does something similar when
> you select view directory as webpage or you somehow customize the display
> of a directory.

probably, imo we are running as fast as we can to mimic Redmond, and
that is a VERY bad thing!

> I think I read somewhere (gnome? kde?) that the info could
> instead be stored on a central file outside of each directory you visit.

agree…like Dolphin could keep all of its little .directory files in a
system file somewhere named registry…oh no! P:


dd CAVEAT: http://is.gd/bpoMD
[NNTP via openSUSE 11.4 [2.6.37.6-0.5] + KDE 4.6.0 + Thunderbird 3.1.10]
Dual booting with Sluggish Loser7 on Acer Aspire One D255

I disagree with the proposal that Dolphin (or others) put that information centraly in a system file. It is information about the users environment and like all private user configuration/information it should go in the the environment of the user (and thus in this case somewhere within* ~/.kde4*).

One could discuss if it should be in the directory itself or centraly in ~/.kde4/share/apps/dolphin (or the like), but the distributed solution has many pros. Like when the directory is deleted (by whoever) the information is deleted and does not stay behind in ~/.kde4/share/apps/dolphin.

IMHO it is a logical consequence of using desktop features. When you do not want all this administration of the desktop software you use, you should simply go for managing your files/directories from the CLI. Or better: use the Desktop for day to day newbie end-user work and when you want to do things professionaly (like the OP seems to do) work professionaly in a seperate subtree of either your home directory or better, do have a seperate user for that professional work (not to interfere with your personal environment of pictures of your wife, etc.) and organise professionaly (and do not put data to be sent to a customer in a directory that is predestined to be part of personal exhibition on the internet).

On 05/31/2011 10:36 AM, hcvv wrote:
>
> I disagree with the proposal that Dolphin (or others) put that
> information centraly in a system file.

i was trying hard to say one thing and at the same time make fun of idea
(“in a system file somewhere named registry…oh no!”) because most
everyone know “the registry” is one of the worst ideas to every come out
of Redmond Washington…


dd CAVEAT: http://is.gd/bpoMD
[NNTP via openSUSE 11.4 [2.6.37.6-0.5] + KDE 4.6.0 + Thunderbird 3.1.10]
Dual booting with Sluggish Loser7 on Acer Aspire One D255

rotfl!

And that it is a bad idea is supported by the fact that in Unix/Linux it could not be done without breaking a lot of security. All the users should have write permission then to a file somewhere in /var or so.
That is more like something that you experience in bad dreams :cry: