Do anyone know how to RENAME a file with SHFILEOPSTRUCT. I can copy and delete with it but can't figure out how to RENAME a file with it.

Also is the a way to COPY, DELETE OR RENAME a file at an lower level in ASM without the help of SHFILEOPSTRUCT.

I already searched previous Posts and did not find anything about it at all. I looked under SHELL and RENAME.

Thanks in advance....
Posted on 2002-03-11 06:16:06 by cmax
These APIs will help you :

CopyFile
DeleteFile
MoveFile (use it for renaming too).
Posted on 2002-03-11 06:24:28 by JCP
>Also is the a way to COPY, DELETE OR RENAME a file at an lower
>level in ASM without the help of SHFILEOPSTRUCT.

Yes, with the use of CopyFile, DeleteFile or MoveFile (move it to rename it :) ). I'm sure, there's no way, to use SHFILE* to rename a file, because there's no special Windows dialog for that. So using MoveFile would be the best way.

>I already searched previous Posts and did not find anything
>about it at all. I looked under SHELL and RENAME.

Search for "MoveFile" and my name. It should bring up one or two Sources where I use this API for renaming a file.

regards,
bAZiK


P.S.: Was this fast? :rolleyes:


Edit:
Arrrghh... Readiosys was faster... :o
Posted on 2002-03-11 06:25:47 by bazik
Thanks Guys

That was very fast and i really needed to know so i can get back to work on it.

bAZiK i been using your codes for strings and it took me very far to understanding ASM a heck of a lot better. It was from the Posts last 1 or 2 months ago back when Strings was the hottest topic. I read everything Readiosys say.

Thanks again
Posted on 2002-03-11 06:55:22 by cmax
Renaming a file is just an encapsulation for moving the file to the same directory under the new name... and moving is an encapsulation for copying and deleting. You probably will not find a rename function in Linux unless you have a special shell for it... all you really have to do is move the file to the same directory with an additional parameter for the new name as Bazik mentioned.
Posted on 2002-03-11 06:55:26 by SpooK
bAZiK, i looked under "MoveFile" and only found three post then i looked under move but there is 100's of posts.

I just go and read the api and come back and search latter if needed.

The best thing about this board is that someone always seem to throw in extra information to keep you from getting tripped up down the line.

Thanks spook, i do want to have everything close as possible for Linux also and your operating system too when ready.
Posted on 2002-03-11 07:16:55 by cmax
Hmm...ok... I had in mind, that I posted some source, wich uses MoveFile to rename a file...
But I'm sure, you won't have any problems to do it yourself, because the API's are very simple to use! Good luck! :alright:
Posted on 2002-03-11 07:27:41 by bazik
while downloading some mp3`s with different extensions i code a small file renamer !
enjoy my bad coding :)

ps: call MoveFileA,offset OLD,offset NEW
Posted on 2002-03-11 07:28:54 by syntax_error
syntax_error, you use Win9x?
I use 2K here at work and look what I got (needs some fixing :grin: ):
Posted on 2002-03-11 07:34:09 by bazik

and moving is an encapsulation for copying and deleting

Not 100% correct :). If you move/rename a file within the same
partition, any (sane) OS/FS combo will just update the directory
entries.
Posted on 2002-03-11 07:42:16 by f0dder
That's why the call him syntax_error

Just kidding ;)

Thats a super super kool program. I wish i had 2K to work on that.
Posted on 2002-03-11 07:49:29 by cmax
<That's why the call him syntax_error

EXACT thats why i take this name :)
its like : yesterday it works today not !

cmax i like you :)
while typing this i must alltime laugh :)
i remeber syntax error from my old c64 days and when i read your answer i see how good this nick is for me *lol*

thanks for the tip bAZiK !
what a luck that i dont mail this tool to the page where i found the mp3`s :)
better fix it first !

ah the sun is shining and id like to jump arround ,coding maybe later in the night :)
Posted on 2002-03-11 09:21:55 by syntax_error
Well I don't have tasm, but I have the same problem with masm under win2k when I don't use the "uses edi edx ecx" (or whatever registers you're using) statement in the starting proc line. Man I'm not so good at the technical wording, but I hope you know what I mean. :)

i.e.
stuff PROC uses ebx ecx blah:dword, blahblah:dword

Like I said I can't re-assemble/link your source to see if that's the problem without tasm, but it's worth a try.
Posted on 2002-03-11 12:55:07 by Will
I took me forever to figure out how to use SHFILEOPSTRUCT and now find out it only take two lines of code to do it ALL, any way you chosse...

Well that's what i get for talking about Bill all the time when i get mad.

Kool syntax_error
It's to much for mp3`s
Posted on 2002-03-11 21:40:23 by cmax