Jump to content

Wildcards not working properly


Recommended Posts

I have define a few additional file patterns to be deleted by CCleaner on a schedule. However, it now appears it has deleted some files it was not supposed to delete. The FileKey in question is:

FileKey3=G:\projects\projects|*.????.rvt|RECURSE

 

This should find all files with a name, followed by "." followed by no more and no less than 4 characters, followed by ".rvt". This is the standard naming of temporary files used by "Revit".

 

Unfortunately, it appears it is not working as it should. A file named "2851.09.rvt" was deleted, and it clearly is not a match for the defined pattern.

Link to comment
Share on other sites

I think you do not understand the effect of a double extension.

 

Neither do I, but I expect a significant change to the old fashioned DOS rules.

 

You do not say if you are using Win 98 under Command.com, or Win XP upwards with CMD EXE.

 

This demonstrates that a 4 byte long file named 2852.09.rvt is included in the mask *.????.rvt;

and that mask is used by both the DIR and the DEL commands of CMD.EXE under Win XP

 

C:\Documents and Settings\Dad>dir *.????.rvt
Volume in drive C is ACER
Volume Serial Number is EC16-8702

Directory of C:\Documents and Settings\Dad

29/03/2010  19:56				 4 2852.09.rvt
		   1 File(s)			  4 bytes
		   0 Dir(s)   9,094,397,952 bytes free

C:\Documents and Settings\Dad>del *.????.rvt

C:\Documents and Settings\Dad>dir *.????.rvt
Volume in drive C is ACER
Volume Serial Number is EC16-8702

Directory of C:\Documents and Settings\Dad

File Not Found

C:\Documents and Settings\Dad>

 

AS a matter of interest, Command.com under Win XP does the same, i.e.

 

C:\DOCUME~1\DAD>dir *.????.rvt
Volume in drive C is ACER
Volume Serial Number is EC16-8702

Directory of C:\DOCUME~1\Dad

29/03/2010  20:10				 4 2835.09.RVT
		   1 File(s)			  4 bytes
		   0 Dir(s)   9,094,377,472 bytes free

C:\DOCUME~1\DAD>del *.????.rvt

C:\DOCUME~1\DAD>dir *.????.rvt
Volume in drive C is ACER
Volume Serial Number is EC16-8702

Directory of C:\DOCUME~1\Dad

File Not Found

C:\DOCUME~1\DAD>

 

But I suspect Win 98 under Command.com will be a totally different matter.

 

Alan

Link to comment
Share on other sites

People still use Windows98? :rolleyes:

 

It appears that the wildcard "?" means "null or matching character", so ".????.rvt" means "one or up to 4 characters before the .rvt", and not "4 characters before the .rvt" as intended. CCleaner appears to work in the same manner as the "dir" command does on XP/Windows2003/Windows2008/W7, and probably uses the same basic API, hence the same functionality. I'll have to look elsewhere for something with regex support to be able to clean out these files, or write something myself ...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.