Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-01-15 13:33:03

sbaguz
Member
Registered: 2021-01-15
Posts: 3

[SOLVED] Change file timestamp.

Hi all,

I'm trying to build a custom action in Thunar to change files date and time using the touch command.
My best guess is:

xfce4-terminal --working-directory %d -x "echo 'Inserisci nuova data e ora nel formato YYYYMMDDhhmm.ss'; read dataora; touch -a -m -t $dataora %f"

but this gives me a "Failed to execute child process [...]. Failed to execve. File or directory doesn't exist." (I'm translating the Italian message...).
In the error message %f is correctly replaced by the file name.
Any other option doesn't even give me any message: I've tried without calling the terminal in the beginning, with bash -c, etc...
Nothing works.

Do you have any suggestion or alternative solution?

Thanks

Bye

Last edited by sbaguz (2021-01-16 14:32:26)

Offline

#2 2021-01-15 15:37:50

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,056

Re: [SOLVED] Change file timestamp.

Hello and welcome.

Use bash -c like this:

xfce4-terminal --working-directory %d -x bash -c 'echo "Enter date (YYYYMMDDhhmm.ss"; read dataora; touch -a -m -t $dataora %f'

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2021-01-16 10:44:48

sbaguz
Member
Registered: 2021-01-15
Posts: 3

Re: [SOLVED] Change file timestamp.

One giant step for human kind...
The previous error has been fixed, thank you very much!
Now, quite strangely, it's the touch command that gives me an error in the date format (which is obviously correct...).

Last edited by sbaguz (2021-01-16 14:27:28)

Offline

#4 2021-01-16 12:55:38

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,056

Re: [SOLVED] Change file timestamp.

The command I posted works for me. Also note that I changed the location of the single and double quotes for it to work properly.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2021-01-16 14:31:22

sbaguz
Member
Registered: 2021-01-15
Posts: 3

Re: [SOLVED] Change file timestamp.

Yes, I had noticed it, but I didn't think it was so important...
But you are totally right: inverting the position of single and double quotes made it work.
Thanks again.

smile

Offline

Board footer

Powered by FluxBB