Search Pattern does not work
Brought to you by:
jlauer12
Special search pattern like *.tmp will not work with version 1.0
Also the recursive directory serach is not working if a pattern is used.
I have modified the code and it is working now.
I have also added a atime option for the last access time.
for details see the attached code
Robert Neubauer
robert.neubauer@pago.ch
Source of version 1.1
Logged In: NO
Both versions fail when I use it. I suspect it doesn't like the spaces or dashes in the file name.
jvail@newts.org
C:\proj\profiler>xdel -filesonly -recurse -dolog -ctime Now-3d *.csv
Run at: 5/6/2008 12:03:47 PM
Deleting files only
Recursive delete is on
Looking at files with creation time older than: 5/3/2008 12:03:47 PM
Directory: *.csv
Pattern: *
Unhandled Exception: System.ArgumentException: Illegal characters in path.
at System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[]
str)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionA
ccess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFul
lPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.DirectoryInfo..ctor(String path)
at xdel.App.GetFilesRecurse()
at xdel.App.Main(String[] args)
C:\proj\profiler>dir
Volume in drive C has no label.
Volume Serial Number is 240D-ED53
Directory of C:\proj\profiler
05/06/2008 12:03 PM <DIR> .
05/06/2008 12:03 PM <DIR> ..
04/29/2008 02:47 PM 24,868 Dispense Profile-Track 5 Coater2-325.csv
05/05/2008 11:28 AM 55,808 Profile Application URS 28 april 29.doc
05/05/2008 02:12 PM 17,454 Track 5 Coater2-342-2008-05-05.csv
05/05/2008 02:25 PM 17,455 Track 5 Coater2-344-2008-05-05.csv
05/05/2008 03:22 PM 17,471 Track 5 Coater2-345-2008-05-05.csv
11/23/2007 04:08 PM 24,576 xdel.exe
05/06/2008 11:48 AM 0 xdel.log.txt
7 File(s) 157,632 bytes
2 Dir(s) 15,891,914,752 bytes free
C:\proj\profiler>
Thanks Robert. This helped me.
For example, to delete GZipped (.gz) files but nothing else from the current directory and subdirectories:
xdel.exe -listonly -mtime Now-10d -filesonly -dolog -recurse ".\*.gz"
Remove "-listonly" to actually do the deletion.
Last edit: Mark Berry 2015-12-05