开发者

How to check the filesize?

开发者 https://www.devze.com 2022-12-11 17:07 出处:网络
Using VB6 I have the text file with different sizes, so i开发者_高级运维 want to delete the file where filesize = 0 kb.

Using VB6

I have the text file with different sizes, so i开发者_高级运维 want to delete the file where filesize = 0 kb.

How to make a vb6 code for deleting the 0 kb files.

Need vb6 code Help


You can use the FileLen function to check the file size.


You can use the FileLen function. See here: http://www.vbforums.com/showthread.php?t=498720


Try this function:

Sub DeleteZeroLengthFile(ByRef sFilePath As String)
' Inputs:  sFilePath        Filename or path name of file to be tested.
' Outputs: <None>
' In/Outs: <None>
' Errors:  Will raise error if file doesn't exist, is inaccessible, is locked, or user
'          doesn't have permissions.

    If FileLen(sFilePath) = 0 Then
        Kill sFilePath
    End If

End Sub
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号