Frage

Given directory ./a and ./b how do I use ruby to set the permissions and timestamps of ./b to be the same as ./a?

War es hilfreich?

Lösung

The touch command (at least on Linux) has a -r option:

   -r, --reference=FILE
          use this file’s times instead of current time

You can call touch from your Ruby program to do what you want. The chmod command has a similar flag.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top