Results 1 to 13 of 13

Thread: How to time stamp a directory

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Resolved How to time stamp a directory

    Given that no one has given a satisfactory answer to this thread I now launch the question anew: how could I set a time stamp to a directory (not to a plain file)? The code linked to in that thread works well under Win2k, but not in 98 or XP.
    Last edited by krtxmrtz; Nov 2nd, 2007 at 04:13 AM.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  2. #2

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: How to time stamp a directory

    bump
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: How to time stamp a directory

    bump again
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  4. #4
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: How to time stamp a directory

    The app in "ChangeFold1816461192004.zip" actually does work, but has at least 2 errors in the code. (I'm using XP Pro)

    In form_load:-
    LastDirIndex = GetSetting(App.EXEName, "Settings", "LastDirIndex", -1 )

    in cmdApplyFolder:-
    GoTo Exit_cmdApplyFolder_Click
    EXIT SUB
    oops:
    'Abort=3,Retry=4,Ignore=5

    Using SetFileTime to change a directory's time/date stamp will always return an error as it wasn't designed for this, even though it (mostly) works. Also see:-

    http://vbnet.mvps.org/index.html?cod...erdatetime.htm

    for their method of "casting" the return value.

    (and you may have to work on the interface )
    Last edited by schoolbusdriver; Jun 1st, 2006 at 02:22 PM.

  5. #5

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: How to time stamp a directory

    Quote Originally Posted by schoolbusdriver
    The app in "ChangeFold1816461192004.zip" actually does work, but has at least 2 errors in the code. (I'm using XP Pro)
    ...
    I've made the changes you point out and it seems to work in some cases, I still have to study the code carefully. I actually set it aside when I saw it gave me those errors.

    Thanks for now.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  6. #6
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: How to time stamp a directory

    For some reason, the hour stamp always seems to out by 1 hour. Possibly because "wDayOfWeek" has been commented out (haven't checked, maybe it's just me...). This could end up as a quite useful tool by adding a calendar control - mscal.ocx, or better still the monthview control in comct232.ocx (and removing the code errors, and modifying the interface, and proper error handlers, and.... Maybe it should just be rebuilt)
    Last edited by schoolbusdriver; Jun 2nd, 2006 at 04:43 AM.

  7. #7
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: How to time stamp a directory

    I've got good reasons to timestamp files (I've already written an app to do this). It's never occurred to me to do the same with directorys'. It seems worthy of a full exe. Oh well, here I go, tomorrow...

  8. #8

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: How to time stamp a directory

    Quote Originally Posted by schoolbusdriver
    I've got good reasons to timestamp files (I've already written an app to do this). It's never occurred to me to do the same with directorys'. It seems worthy of a full exe. Oh well, here I go, tomorrow...
    Yes, I recently finished writing my own file time-stamping utility as well. The main purpose was to sort by time some mp3 files. If it's not just a song but, say, a Beethoven symphony, if the 2nd movement was completely downloaded before the 1st, then when I played it in a mp3 device, this 2nd movement was played first.
    The directory thing is not actually necessary but I thought I might need it some time in the future.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  9. #9
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: How to time stamp a directory

    If I've done this right, there should be a zip file attached with a reincarnation of my date/time changer. It needs mscomct2.ocx, and will only change folder dates/times on win2k or later (or so the MS docs say). The code's too big to post, and there's no help file of course If you have any probs...
    Attached Files Attached Files

  10. #10

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: How to time stamp a directory

    Quote Originally Posted by schoolbusdriver
    If I've done this right, there should be a zip file attached with a reincarnation of my date/time changer. It needs mscomct2.ocx, and will only change folder dates/times on win2k or later (or so the MS docs say). The code's too big to post, and there's no help file of course If you have any probs...
    Nice code, indeed
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  11. #11
    Fanatic Member ididntdoit's Avatar
    Join Date
    Apr 2006
    Location
    :uoıʇɐɔoן
    Posts
    765

    Talking Re: How to time stamp a directory

    Project is broken. Has spaces instead of :'s in between numbers in times, so gives error when trying to convert to system time. Easily fixed, just thought I'd mention it 4 the next one to download it and have to trouble shoot for a while.

    BTW,
    Lottery is a tax on people who are bad at maths.
    i though it was called the idiot tax?
    Visit here to learn to make the VB interface fit you!.
    "I have not failed 10,000 times. I have successfully identified 10,000 ways that will not work" Thomas Edison
    "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners" -- Ernst Jan Plugge

  12. #12

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: How to time stamp a directory

    Quote Originally Posted by ididntdoit
    ...
    BTW,
    i though it was called the idiot tax?
    Yes, but you can't be so rude to people.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  13. #13
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: How to time stamp a directory

    Quote Originally Posted by ididntdoit
    Project is broken. Has spaces instead of :'s in between numbers in times, so gives error when trying to convert to system time. Easily fixed, just thought I'd mention it 4 the next one to download it and have to trouble shoot for a while.
    Strange - works OK on my PC. Can't check it on anything other than XP Pro. Can you post the bit that gives the error - and a correction of course

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width