SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
method for checking zero byte files

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
method for checking zero byte files
Author Message
mojoyrider



Joined: 07 Aug 2007
Posts: 20

Post method for checking zero byte files Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7951

Post Reply with quote
FileSize
Mon Oct 01, 2007 6:08 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7951

Post Reply with quote
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

Code:
FOR /F %i IN C:\path_to_files\*.* DO (IF "%~zI" == "0" DEL %~fsI)

Mon Oct 01, 2007 6:19 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.