News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Utility for touching files and directories

Started by davk, August 08, 2006, 04:48:32 AM

Previous topic - Next topic

davk

Here is a utility for touching and lower-casing files and subdirectories, recursively.
It only works under Win9x however but hey, thats me.

Somewhat entertaining finding out how to do this under Win9x, as the source shows.

Cheers all

PS: TLC.ZIP is actually TLC.RAR so rename it if you have problems unpacking. Why does
this forum not allow attaching rar files?.


[attachment deleted by admin]

Shantanu Gadgil

Hi, Nice to know someone else also is working on  the same...

Check this out...
http://www.masm32.com/board/index.php?topic=3026.msg32539#msg32539

works on WinXP too!!!

Cheers,
Shantanu
To ret is human, to jmp divine!

davk

Shantanu

Already have and I use your great utilities myself. Thanks.

However I wanted a command line utility for use in batch files and your touch32 would not
touch directories - I got a little warning dialog giving CreateFile error on each directory. I
presume the "Access Denied" error (5) I got from the api myself. Note I am using W98SE.

Cheers

Shantanu Gadgil

QuoteI got a little warning dialog giving CreateFile error on each directory
Oohhh! Sorry! I use and have only tested in on WinXP systems.

But...CreateFile errors? I have done them quite some time ago so I don't remember what API's I have used. Don't think there should be any CreateFile though. Will check it in detail when I go home.

One thing that I do remember is that, it wouldn't touch folders that were open in Windows Explorer. Closing Windows Explorer would solve that.

Anyway, thanks for the feedback!
Regards,
Shantanu
To ret is human, to jmp divine!

Shantanu Gadgil

Hi davk,
I have gone through the code and YES...there IS a CreateFile() call!!! du-uh...

OK...the code that would be causing trouble would be

mov eax,FILE_ATTRIBUTE_NORMAL
.if bDirectory == TRUE
.if osvMain.dwPlatformId == VER_PLATFORM_WIN32_NT ;added NOW
or eax,FILE_FLAG_BACKUP_SEMANTICS
.endif
.endif
invoke CreateFile,lpszFileName,GENERIC_WRITE,0,0,OPEN_EXISTING,eax,0


I just checked that the FILE_FLAG_BACKUP_SEMANTICS is for WinNT OSes only!!!  ::) ::)

Modifications to Touch32...
* the CreateFile() will no longer pop-up an error message and will silently fail

Could you please check if the new Touch32 one works ok under Win9x?
http://www.masm32.com/board/index.php?topic=3026.msg32539#msg32539

Regards,
Shantanu
To ret is human, to jmp divine!

davk

Shantanu,

Yes, works fine without any error dialogs.

Doesn't touch directories however...


Shantanu Gadgil

To ret is human, to jmp divine!