How to prevent changing of modification timestamp

Advertisement

wyo
Joined:
Posts:
4

How to prevent changing of modification timestamp

I'm using WinSCP to copy files to my webserver directories (unix server). Yet I've added a new folder and files into a folder. This containing folder changes then its modification timestamp but I though that's not the way how Unix handles timestamps on folders. Is this a problem of WinSCP?

Since Unix seems to have no fixed creation timestamp is there a workaround to keep or restore the timestamp? Somehow to achieve a fixed creation timestamp?

O. Wyss

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: How to prevent changing of modification timestamp

When does the timestamp change? Do you mean creation or modification timestamp?

Reply with quote

wyo
Joined:
Posts:
4

Re: How to prevent changing of modification timestamp

martin wrote:

When does the timestamp change? Do you mean creation or modification timestamp?

Modification timestamp. When I add a new folder, the containing folder gets a new modification timestamp.

O. Wyss

Reply with quote

martin
Site Admin
martin avatar

Re: How to prevent changing of modification timestamp

I did few tests and obviously at least on linux, the modification timestamp of directory behaves as you describe. When new subfolder is created, timestamp of parent directory is updated to current time.

Reply with quote

wyo
Joined:
Posts:
4

Re: How to prevent changing of modification timestamp

martin wrote:

I did few tests ...

I can be mistaken but I think the containing folder should not change. Anyway is there a command to set the timestamp to a specified value?

O. Wyss

Reply with quote

Advertisement

o_o
Joined:
Posts:
10
Location:
Germany

Re: How to prevent changing of modification timestamp

wyo wrote:


I can be mistaken but I think the containing folder should not change. Anyway is there a command to set the timestamp to a specified value?

O. Wyss

If you want to change the timestamp on Linux, consider using the touch command. For e.g.

# touch myfile.txt

changes the timestamp of myfile.txt to the current time. For more information either do a man for touch, or look at the Wikipedia article at the bottom of which some examples are given.

Reply with quote

wyo
Joined:
Posts:
4

Re: How to prevent changing of modification timestamp

o_o wrote:

wyo wrote:


I can be mistaken but I think the containing folder should not change. Anyway is there a command to set the timestamp to a specified value?

O. Wyss

If you want to change the timestamp on Linux, consider using the touch command. For e.g.


Sorry I asked to know if WinSCP could change the timestamp anyhow. Else it might be a nice enhancement.

O. Wyss

Reply with quote

martin
Site Admin
martin avatar

Re: How to prevent changing of modification timestamp

wyo wrote:

Sorry I asked to know if WinSCP could change the timestamp anyhow. Else it might be a nice enhancement.
WinSCP does not support that. Neither I consider it useful for large enough audience. Sorry :-(

Reply with quote

Advertisement

You can post new topics in this forum