Re: Translations of folder names - two proposals



Today at 16:37, Damon Chaplin wrote:

> I'm not sure it is wise to do stuff like this in a script anyway:
>
>   "cp file ~/.folder/Templates"

Doing "rm -rf $a/$b" is not very wise either, but it's done in scripts
as well.  It's up to the script author to do at least:
  "cp file ~/.folder/Templates/"
which will ensure that no "Templates" file would be created if such
directory doesn't exist.

> For that to be OK we'd need to guarantee that all the special folders
> always exist (i.e. the user is not allowed to delete them).
>
> To work robustly the script would need to check if the folder existed,
> create it if it wanted to (recursively?), and then copy the file into
> it. The utility app would simplify this, e.g.

Perhaps the non-existense of the directory should mean that user
doesn't want it?  Above solution would handle that :)

Cheers,
Danilo



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