[physfs] some questions

Indy Sams indy at driftsolutions.com
Tue Jan 15 15:39:36 EST 2008


      I took a look at windows.c and I must say, Windows time code is
      a big PITA. My suggestion would be to just use _wstat64/_stat64
      and let it do all the work hehe.
      Info URL: http://msdn2.microsoft.com/en-us/library/14h5k7ff(VS.71).aspx

      Also on a side note regarding the "!!! FIXME: what do they call
      advapi32.dll on Win64?"-type comments in the source: The files will have
      exactly the same name (ie. there won't be a kernel64.dll, etc.).
      Microsoft's official stance is that the Windows API is called the
      "Win32 API", regardless of how many bits the OS is, so everything
      will still be called 32.

Tuesday, January 15, 2008, 2:54:43 PM, you wrote:

AB> Le jeudi 10 janvier 2008, Ryan C. Gordon a écrit :
>> > 1/ We had problem on windows xp, with PHYSFS_getLastModTime
>> > it seemed to return something else than the expected date.
>> > I don't have windows myself, so i cannot tell more, but i can ask
>> > for details if needed.
>> Can you get details on what value it reports and what it was supposed to 
>> report? We have to convert from the Windows time scale to a Unix one, 
>> and it's possible we do it incorrectly.
>> Also, what time zone is it failing in? We use the current system's 
>> timezone in the conversion, which may be causing issues.
>> --ryan.
AB> Here is the code we have:
AB> with linux it works nicely and only shows the latest file,
AB> with windows xp, we stop as soon as we find one file matching our pattern
AB> (begin by filestart.str()="1_" , or "2_" etc....)

AB>         PHYSFS_sint64 t = 0;

AB>         while( ( curfile = readdir( lincityDir ) ) ) { 
AB>             if(std::string( curfile->d_name ).find( filestart.str() ) == 0 ) {
AB>                 // && !( curfile->d_type & DT_DIR  ) ) is not portable. So
AB>                 // don't create a directoy named 2_ in a savegame-directory or
AB>                 // you can no longer load from slot 2.
AB>                 if (t == 0) {
AB>                     recentfile = curfile;
AB>                     t = PHYSFS_getLastModTime(recentfile->d_name);
AB> #ifdef WIN32
AB>                     //something is broken in Windows
AB>                     break;
AB> #endif              
AB>                 } else {
AB>                     if (PHYSFS_getLastModTime(curfile->d_name) > t) {
AB> #ifdef DEBUG
AB>                         fprintf(stderr," %s is more recent than previous %s\n",
AB>                                                 curfile->d_name, recentfile->d_name);
AB> #endif
AB>                         recentfile = curfile;
AB>                         t = PHYSFS_getLastModTime(recentfile->d_name);
AB>                     }
AB>                 }
AB>             }
AB>         }

AB> I'll ask for sample values on windows.
AB> Alain

AB> ---
AB> To unsubscribe, send a blank email to physfs-unsubscribe at icculus.org
AB> Mailing list archives: http://icculus.org/cgi-bin/ezmlm/ezmlm-cgi?4

Best regards,
 Indy Sams
 mailto:indy at driftsolutions.com

 P.S. This is what part of the alphabet would look like if Q & R were eliminated.

More information about the physfs mailing list