 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
mojoyrider
Joined: 07 Aug 2007 Posts: 20
|
|
method for checking zero byte files |
|
We have to process files, however the directory that contains these files has both normal data files and zero byte files (no data in them). They are being imported into a commercial application that cannot process or effectively handle the zero byte files and it hangs.
So our script needs to move the data files that contain data to the commercial application server, but move the zero byte files to an archive directory (or delete them).
Is there a method in JAL to determine the files attributes such as file size?
|
|
Mon Oct 01, 2007 6:02 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7951
|
|
|
|
FileSize
|
|
Mon Oct 01, 2007 6:08 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7951
|
|
|
|
This can be actually done much easier using single line batch file. Check help topics for DOS "for" command, specifically check usage of "%~zI" modifier, you should be able to construct 1 line "for" command listing all files and applying IF and DEL logic to each zero-size file, something like the following
 |
 |
FOR /F %i IN C:\path_to_files\*.* DO (IF "%~zI" == "0" DEL %~fsI) |
|
|
Mon Oct 01, 2007 6:19 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|