Login  
Search All Forums
Dart Home | PowerTCP Zip Compression for Active | Custom Development Reply | PowerTCP Zip Compression for ActiveX Topics | Forums   
AuthorForum: PowerTCP Zip Compression for ActiveX
Topic: Function to check the existence of a file...
karthiksp

From: West Palm Beach, FL USA
Posts: 60
Member Since: 08/04/05
posted April 16, 2007 6:08 PM

Hi All,
 
   Is there a function or method that I can use to check a particular file exists in the FileStore Object that I loaded in the memory.

   We are using Powerbuilder as our front end application.

Any help or hint will be appreciated.

Karthik
Amit

From: Rome, NY USA
Posts: 315
Member Since: 03/15/06
posted April 17, 2007 3:09 PM

Hello Karthik,

Regarding the query, I am not much experienced in PB however you can check whether a particular file exists in the FileStore object or not. Here is a very small example in VB 6:


Dim file As file
'Load a ZIP File to the FileStore. This zip file contains 4 files: test1.txt, test2.txt, test3.txt, ‘test4.txt
Zip1.FileStore.Load "D:\testing.zip"
'Iterate through FileStore and check for file test1.txt
‘Using Vb6, you may use Select Case also
For Each file In Zip1.FileStore
If file.Name = "test1.txt" Then
MsgBox "File Found"
Else
MsgBox "file not found"
End If
Next

Do let me know if you require further assistance/ clarifications.

Regards,
Amit
karthiksp

From: West Palm Beach, FL USA
Posts: 60
Member Since: 08/04/05
posted April 17, 2007 3:19 PM

Amit,
 
  First of all thanks for your reply. Logic what you posted is the one that we currently using in our application.

   Since our zip files has atleast 50 files in it and almost we need to process 20 zip files in a day. That's why I asked instead of iterating into individual file, is there a funtion that we can use for the file existence.

   Please let us know, Is there any other way that we can achieve this.

Thanks for your hint
Karthik
Amit

From: Rome, NY USA
Posts: 315
Member Since: 03/15/06
posted April 18, 2007 2:23 PM

Hi Karthik,

The only way you can check for the existence of a file is by iterating through all of the files. 

Regards,
Amit
Mike Baldwin (Admin)



From: Rome, NY USA
Posts: 114
Member Since: 04/11/00

Extra Support Options
Custom Application Development

posted May 7, 2007 12:40 PM

When the Load() method is used to load an existing zip file, none of the zipped files are decompressed. It is therefore a relatively inexpensive operation to iterate through the zipped files, looking for the file in question.
Reply | PowerTCP Zip Compression for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX