op.pFrom,SHfileoperation,need help 
Author Message
 op.pFrom,SHfileoperation,need help

newbie::Hi,

I am enterring the delete path from the keyboard: Enterred the
"c:\data1\*.*" path without the quotation marks and it gives the
error "Erasing . + .." ,no mention of "t*.*" files, also gave the
"Failed ...." message. It seems that paths are not passed around
right. why?
J

void ExistsFiles(char *filespec)
{
WIN32_FIND_DATA fd;
    HANDLE h=FindFirstFile(filespec,&fd);
    bool done=h==INVALID_HANDLE_VALUE;
    if (!done) {
                printf("Erasing %s + .. \n",fd.cFileName);
        }
        else {
            printf("Could Not Find The File(s) to Delete ...\n\n");
            exit (1);
        }
    FindClose(h);

Quote:
}

int main() {
char str[80];
.
.
.
printf("Enter path:i.e.,C:\\data1\\*.*\n");
gets(str);
//scanf("%s",str);
op.pFrom = str;.
.
.
for(;;){
ExistsFiles(str);
.
.
int t;
t = SHFileOperation(&op);
if (t){
printf("Failed ...");
 }

Quote:
}
}

Sent via Deja.com
http://www.*-*-*.com/


Fri, 06 Jun 2003 11:03:14 GMT  
 op.pFrom,SHfileoperation,need help

Quote:
>I am enterring the delete path from the keyboard: Enterred the
>"c:\data1\*.*" path without the quotation marks and it gives the
>error "Erasing . + .." ,no mention of "t*.*"

"." is the current directory item - it is a valid enumerated file when
you use FindFirstFile. You usually need to explicitly skip the "." and
".." values returned by FindFirstFile/FindNextFile.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Fri, 06 Jun 2003 16:56:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. SHFileOperation(&op);op.pFrom

2. op.pFrom from keyboard

3. keyboard op.pFrom

4. SHFileOperation() I Need Help...

5. Need help to use SHFileOperation

6. SHFileOperation - need to know number of copied files

7. SHFileOperation - need to know number of copied files

8. SHFileOperation in NT...Please help

9. SHFileOperation Help

10. SHFileOperation help!

11. SHFileOperation fails for me - help requested

12. bitwise op for MSB ?

 

 
Powered by phpBB® Forum Software