<< back to sysax.com Product page

14.3. Using timestamps

Timestamps or portions of timestamps are frequently added to file names. The following examples show how time stamps can be appended to files and how file names can be searched for specific timestamps.

Exhibit 14.5. Example for using timestamps

gettimestamp ~my_timestamp; # generate current timestamp

foreach $local_item in @local_list begin
  strprint ~new_name, ~my_timestamp, "_", $item.name; #prepend timestamp to file name
end



gettimestamp ~my_timestamp, decr, day, 1; #generate timestamp that is a day old

foreach $local_item in @local_list begin
  strprint ~search_name, "*", ~my_timestamp, "*"; #generate search string
  if ~search_name eq $local_item.name begin
    #search for files with this timestamp as part of their filename
  end
end