Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read date and time from .avi file

Status
Not open for further replies.

nzoli

Programmer
Feb 17, 2011
22
HU
Hi all again!

I have another "little" problem.

So I converted some .avi files to .mkv files. The converter program wasn't able to copy the .avi's files original create date and time and all of my new .mkv files gived the actual date and time. (I tried dozen's of converter program, but overall that was the best) (HandBrake)

My colleague wrote me a small foxpro (old dos platform) program, that should be solved the problem, but it is only working on 32bit system with 8.3 char files. I have only long filenames files and I have more than a hundred converted files.

So how can we convert the old program to VFP?
I attached his sourcecode.

Problem: I have abcd_abcdfg.avi and abcd_abcdfg.mkv (same name with different extension)in same folder. I would like to copy the .avi's file date and time to the .mkv files


First of all sorry for my english and thanks for your respond!

Best Regards
Zoltan Nagy

 
Hi Zoltan,

At a first glance at your colleague's progam, I can't see any reason that it shouldn't work with long filenames. But you haven't given us the source of the setfdate() and setftime() functions. Maybe it's in those functions where the problem lies.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
What's the problem? You can run 32 bit software on 64bit os, and longer file names still also have a dos name, see ADIR() nFlags parameter bit 1 (valued 2) will return 8,3 dos names to use for the fll.

Besides foxtools.fll has a foxtouch method setting file dates, see and this fll handles long file names without their dos equivalent name, too.

Bye, Olaf.
 
@MikeLewis
I attached the setfdate() and setftime() source of functions!

@OlafDoschke: Yes I know, but I have Win7Home64bit and it is not supporting the virtualisation.
But yes I forgot the virtualbox! When I get home, I will try it!
thanks for the idea!

best regards
 
 http://optimer.hu/nzoli/SETDTTM.C
Zoltan,

Thanks for the setfdate() and setftime() code. However, Olaf's suggestion is much simpler, and will work reliably on your system.

All you have to do is this:

SET LIBRARY TO foxtools.fll

Then call FoxTouch(), passing the filename and the parameters for year, month, day, hour, minute, second, in that order.

If you plug that into your code in place of setfdate() and setftime(), you should have a working solution.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top