Home AWE

Detecting Zero Byte Files?

crussocrusso Posts: 15 Resident

Does anyone have a solution to detect zero byte (empty) files using AWE funtionality?

Comments

  • kkoponenkkoponen Posts: 6 Resident

    Assuming you're passing %FS.PATH% for a specific file from an event rule you can use Get "%varFilePath%" file(s) information (AMGETFILEINFO) checking the "Size" file property. If the file size is zero you can either create an error with something like set a variable you haven't created to some value or Return (AMRETURN) the value %Error(errorcode)% where I used the 28033, file not found, code.






    Hope this helps!

  • kkoponenkkoponen Posts: 6 Resident






  • crussocrusso Posts: 15 Resident

    Thank you, kkoponen.

    I received your e-mail of the AML code that, for whatever reason, would not post in this forum. Within your code you identify the FILEPROPERTY="Size" and that made me remember that there is actually an action within the AWE functionality to return the file size called, "Get File(s) Information". I'm not sure why I didn't see this before.

    kkoponen's code:

    Get File(s) Information action example:

    From there, all I need to do is check if the %fileAttributes% is zero. Nice.

Sign In or Register to comment.