Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to distinguish doc and docx count
Message
From
21/06/2012 12:09:51
 
 
To
20/06/2012 16:34:42
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01546401
Message ID:
01546525
Views:
46
thanks dragan for showing how complicated life can really be if you tried hard enough.

k

>>I am saving email attachment in directory called attachments.
>>I then do a count to determine if the file is a .doc or a .docx
>>
>>the count i am using does not seem to distinguish between the two. I have ONE file in attachments which is a .docx
>>instead i am getting 1 count for doc AND i count for docx.
>
>BTW, since .docx is actually a zipped folder with a bunch of xml files inside (and subfolders with more of the same), you can physically distinguish the two by opening each file low-level, reading the first two bytes, and checking if these two are "PK" (signature of Phil Katz, who wrote the original PKZip).
>
>I had to do so in one case, where some .doc files were actually docx files, saved under the old extension.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform