Programmer's Reference

Setting the timestamps of a file

You can set the access and modification timestamps of a file by sending the touch: or touch:time: message to the CfsFileDescriptor class. The touch: message will set the timestamps to the current date and time (equivalent to the POSIX touch -amc command). The touch:time: message will set the timestamps to a specified value (equivalent to the POSIX touch -amc -t command). For example:

CfsFileDescriptor touch: 'filename.txt'

has the same effect as the following code::

CfsFileDescriptor touch:'filename.txt' time: (Array with: Date today with: Time now)


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]