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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NERD code driving me NUTs at work!!!!!!!!!!!!!

Status
Not open for further replies.

Iceman2005

Programmer
May 6, 2005
22
US
guys.... i have taken over a project from my coworder and i need to do some coding on whatever was left there......

i came upon this peice of code and heck i didnt understand what the guy was thinking or trying to do here....

anyone can help me here?

WIN32_FIND_DATA st = {0};

...

*((__int64*) &st.ftLastWriteTime ) += __int64(10000000*60*60*24);

...


anyone?

thanks.
ice



 
I think it says to add 1 day to the LastWriteTime of the file that was found.
If you see that co-worker again, make sure to give him a slap for not documenting very well... ;)
 
ice,

The WIN32_FIND_DATA is a structure that is filled by FindFirstFile() or FindNextFile(). Your programmer has cleared st (set all members to 0). st is a WIN32_FIND_DATA structure. Before adding a day, pointed out by cpjust, there must be a FindFirstFile() or FindNextFile() where the st structure is filled. Then the day can be added to the ftLastWriteTime member.



HyperEngineer
If it ain't broke, it probably needs improvement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top