1#!
2#[[BEGIN PROPERTIES]]
3# Type = Command
4# Order = 2.0
5# Interpreter = perl
6# Caption = touch
7# Descr =Change the time stamp of one or more files and/or directories.
8# Descr =The new time stamp is asked.
9# Descr =
10# Descr =Selection details:
11# Descr =
12# Descr =  Source: Ignored.
13# Descr =
14# Descr =  Target: The files and directories which shall get the new time
15# Descr =          stamp.
16# Icon = file_time.tga
17# Hotkey = Meta+T
18#[[END PROPERTIES]]
19
20use strict;
21use warnings;
22BEGIN { require "$ENV{'EM_DIR'}/res/emFileMan/scripts/cmd-util.pl"; }
23
24if (IsFirstPass()) {
25
26	ErrorIfNoTargets();
27
28	ConfirmIfTargetsAcrossDirs();
29
30	my $tm=Edit(
31		"touch",
32		"Please enter a new time stamp for the target(s), or leave\n".
33		"blank for using the current time. The time stamp format is:\n".
34		"[[CC]YY]MMDDhhmm[.ss]",
35		""
36	);
37
38	SetFirstPassResult($tm);
39
40	SecondPassInTerminal("touch");
41}
42
43my $tm=GetFirstPassResult();
44
45my $e=TermRunAndSync(
46	"touch",
47	($tm ne "") ? ("-t", $tm) : (),
48	"--",
49	GetTgt()
50);
51
52SendUpdate();
53
54TermEnd($e);
55