Page 1 of 1

CTMFW with wild card and file size

Posted: 23 Apr 2007 5:02
by Deano
Hi, I am performing a file watch on a file that contains a wild card:-

ctmfw "E:\Interfaces\tmp\axa_to_jpm_fx_q_to_file*.txt" CREATE 1 1 3 3 10 Y

I want the job to fail unless the file it finds is at least 1 byte in size.

I have read that by adding the Y at the end of the command line, that it will take size into account, but this is not working.

Any ideas? :?:

Posted: 24 Apr 2007 5:14
by fyot
Hi,

Ctmfw and wilcard run together only to test file creation.
Try again with simple quote.

ctmfw 'E:\Interfaces\tmp\axa_to_jpm_fx_q_to_file*.txt' CREATE 1 1 3 3 10 Y

Posted: 25 Apr 2007 11:49
by Deano
Many thanks.

I tried again using the single quotes and it worked fine. Even taking the size into the equation.

Deano

Posted: 02 May 2007 10:15
by Deano
Oops! This only half works!!

The command above will fail if a 0 byte file is detected, but will not complete successfully if a file of 1 byte or greater is detected.

So, unfortunately, this is not a solution. It looks like a command file is the only way to perform this task.

Posted: 24 Jul 2007 7:06
by mauriziog
From the ctmfw documentation for CREATE mode:

"Detects creation of a file. Default. File size is ignored if the filename
parameter contains wildcards (unless the monitor file size when
wildcard is used parameter is set to Y).

Note: If a mask is specified for the filename, and the monitor file size
when wildcard is used parameter is set to
■ N, the ctmfw utility will end OK after detection of the first file that
matches the specified mask.
■ Y, the ctmfw utility will end OK after detection of the first file that
matches the filename and file size. "

and more:
"If this parameter is set to Y and more than one file matches the specified mask, the ctmfw utility randomly selects one matching file, monitors its file size, and ignores all other matching files."

The monitor of the creation and the size works only for the FIRST file, the others are not monitored. This can be your problem like was for me.
If you want to monitor the creation and the size grow of all the files, you must run the utility for all the files.

Posted: 15 Jan 2011 7:29
by Hawkes852
Wonderful post...

Posted: 16 Feb 2012 12:26
by ahtisham454
A really nice idea. I appreciate it much !

Posted: 08 Jan 2013 7:04
by soli032
Hi thanks for share awesome ideas keep it up