How to alias or rename a file on the fly in Linux?

190 Views Asked by At

I have the following challenge under Linux:

  • An application is writing a config-file "samename.cfg" into certain directories
  • I want to have the config-file named different for each directory
  • I do not want any file called "samename.cfg" written to the directories
  • I can not change it in the application

So I would like to have the application thinking that it accesses samename.cfg but in fact it reads and writes anothername.cfg. Symlink does not help, because then there still is a file called samename.cfg in every directory.

Anybody any idea?

Regards, Axel

1

There are 1 best solutions below

0
mtnezm On

Try using a hard link instead of a soft link when using ln command (just remove the -s flag).

See ln man's page for more details.