Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Is It Possible to Determine What Program Creates a Directory?

  1. #1
    Join Date
    Dec 2007
    Beans
    657

    Is It Possible to Determine What Program Creates a Directory?

    I don't like having to capitalize directory names when working in command line, so I have renamed my Documents, Downloads, Music, Videos and Pictures directories to all lowercase names. For some reason, some program keeps recreating the Downloads directory with a capital D. Normally, I wouldn't care - I'd just forget about the capitalized one. The problem is, though, that when I run a windowsXP VM, it confuses the heck out of the windows OS and nothing works right when trying to read/write from the downloads directory until I remember to delete the capitalized directory.

    Is there any way that I can tell what program keeps recreating this directory so I can tell it to freaking stop!?

  2. #2
    Join Date
    Dec 2018
    Location
    Paris, France
    Beans
    12

    Re: Is It Possible to Determine What Program Creates a Directory?

    As far as I know, from what I've read out there about files, there is no way to check who or what created a file. I assume it's the same thing with directories.

  3. #3
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Is It Possible to Determine What Program Creates a Directory?

    You might be able to apply inotify to watch for changes to a file or directory and associate that detected change with launching some applications.

  4. #4
    Join Date
    Dec 2014
    Beans
    1,849

    Re: Is It Possible to Determine What Program Creates a Directory?

    There should be a file named 'user-dirs.dir' in the hidden directory '~/.config'. The names for standard directories are set in this file and these directories are created during system start-up if they don't exist. Edit that file to contain the names you want the directories to have and the problem should be fixed ...

    Holger

  5. #5
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,414
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: Is It Possible to Determine What Program Creates a Directory?

    Quote Originally Posted by rebeltaz View Post
    Is there any way that I can tell what program keeps recreating this directory so I can tell it to freaking stop!?
    In general, no. In this case, it's xdg-user-dirs doing exactly what it's supposed to: making sure you have the standard directories and making sure they're called what you've configured them to be called.

    It's easy to configure those directories to be called something else. The whole point of the XDG spec is to separate their name from their function, for localisation, and user preference, and the like.

  6. #6
    Join Date
    Dec 2007
    Beans
    657

    Re: Is It Possible to Determine What Program Creates a Directory?

    Quote Originally Posted by Holger_Gehrke View Post
    There should be a file named 'user-dirs.dir' in the hidden directory '~/.config'. The names for standard directories are set in this file and these directories are created during system start-up if they don't exist. Edit that file to contain the names you want the directories to have and the problem should be fixed ...

    Holger
    Quote Originally Posted by CatKiller View Post
    In general, no. In this case, it's xdg-user-dirs doing exactly what it's supposed to: making sure you have the standard directories and making sure they're called what you've configured them to be called.

    It's easy to configure those directories to be called something else. The whole point of the XDG spec is to separate their name from their function, for localisation, and user preference, and the like.
    Apparently, and I have long since forgotten, but this must have been how I changed the directory names to begin with. This is the contents of that file:

    Code:
    XDG_DESKTOP_DIR="$HOME/Desktop"
    XDG_DOWNLOAD_DIR="$HOME/downloads"
    XDG_TEMPLATES_DIR="$HOME"
    XDG_PUBLICSHARE_DIR="$HOME"
    XDG_DOCUMENTS_DIR="$HOME/documents"
    XDG_MUSIC_DIR="$HOME/music"
    XDG_PICTURES_DIR="$HOME/pictures"
    XDG_VIDEOS_DIR="$HOME/videos"

  7. #7
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Is It Possible to Determine What Program Creates a Directory?

    I'm just brainstorming, but you could set the permissions to prevent your userid to access the configured directory, then either an alert or log entry would probably contain the program that failed to work.

    Unix is case sensitive, BTW. That's a feature. Actually, every popular OS is case sensitive except 1, within the limitations of the file system(s) being used. Different file systems have different limitations.

  8. #8
    Join Date
    Dec 2007
    Beans
    657

    Re: Is It Possible to Determine What Program Creates a Directory?

    Quote Originally Posted by TheFu View Post
    I'm just brainstorming, but you could set the permissions to prevent your userid to access the configured directory, then either an alert or log entry would probably contain the program that failed to work.

    Unix is case sensitive, BTW. That's a feature. Actually, every popular OS is case sensitive except 1, within the limitations of the file system(s) being used. Different file systems have different limitations.
    How would I go about setting those permissions?

    As far as the capitalization goes, normally, I don't mind - I actually use that to my advantage. It's just this one instance that is giving me fits because I am sharing one directory between two OS's.

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Is It Possible to Determine What Program Creates a Directory?

    Quote Originally Posted by rebeltaz View Post
    How would I go about setting those permissions?
    Code:
    chmod 000 ~/path/to/directory
    Be certain to keep track of what the permissions were before, so you can put them back.

  10. #10
    Join Date
    Dec 2007
    Beans
    657

    Re: Is It Possible to Determine What Program Creates a Directory?

    So I set these permissions on the directory I do not want - the one with the capitalized D, right?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •