Syntax
ftouch(fname)
Input Parameter
Examples
ftouch('pcodeTL.m')
Copyright 2020-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This algorithm is a MATLAB function named ftouch
designed to update the modification timestamp of a file on macOS systems. It is part of the SolidGeometry library and was introduced in version 4.9. The function does not support wildcards and only operates on single files.
Input Parameters
- fname: The exact filename of the file whose timestamp is to be updated. It must be a full filename, and the function does not support wildcards.
Algorithm Steps
- The function first checks if the operating system is macOS using
ismac
. If not, it throws an error stating that the function is only supported on macOS.
- It checks if the
fname
contains a file separator. If not, it prints a debug message indicating that the file is in the current directory.
- The function then checks if the filename starts with
/Volumes
. If it does not, it assumes the file is in the current directory and constructs the full path using the current directory path and the filename.
- If the file exists, it constructs a system command to update the file's modification timestamp using the
touch
command with the -m
option.
- The system command is executed using the
system
function, and the result is stored in fail
.
- If the file does not exist or the system command fails, a warning is issued indicating that the file does not exist or is write-protected.
Algorithm explaination created using ChatGPT on 2025-08-18 23:51. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21