Raymond Tsang Posted April 24, 2009 Report Share Posted April 24, 2009 Hi LAVAs, I want to write a VI which "touches" a file. By "touch", I mean, to update the "last modified time" of a file without modifying its content. Using System Exec.vi, I made a simple VI (attached screenshots), but it doesn't do what it is supposed to do and return no error. I'm really puzzled . Any ideas? Ray Quote Link to comment
ShaunR Posted April 24, 2009 Report Share Posted April 24, 2009 Wire an indicator to the Standard out and you will see the result from your call to the DOS box. You don't get an error because the SystemExec successfully completed the CMD call. However, the DOS box may not have executed the copy command. If you look in the windows help, they suggest making a batch file with the command options and calling that. I personally would use a "Call Function Block Node" to call a windows API to achieve what you are trying to do. (Kernel32.dll has a SetFileTime function). Although there may be an easier/more elegant method. Quote Link to comment
asbo Posted April 24, 2009 Report Share Posted April 24, 2009 You could use an alternative approach like the attached to update the timestamp on the file. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.