[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: not wanting to delete somebody's home directory

mick crane wrote:
> hello,
> I doing some code in perl and I'm not very good at it.
> code makes some images and saves them to a directory.
> If the directory doesn't exist it gets made and if it does exist all the 
> files in it get deleted before putting some new ones in.
> I'm thinking that if I ever give it to somebody it's possible they might 
> call the directory
> "~/" or something and end up deleting all their files, which I'd like to 
> avoid.
> How would that best be avoided ?
> Is that something to do with chroot which I don't know anything about.

  always put things in a subdirectory.

  there is normally a directory named .local/share/<program-name>/ 
used for such things (or create it if it isn't there).

  if you have any configuration information that can be saved in
the .config/<program-name>/ directory (or again create it if it 
isn't there).


Reply to: