When I create directory with CreateDirectory on StorageCard I can't put
anything in it (e.g. with MoveFile() function). Also, can I change
attributes of that newly created directory? Thanks for replying!

Re: CreateDirectory() won't work... by Alex

Alex
Sat Nov 19 01:07:47 CST 2005

blue wrote:
> When I create directory with CreateDirectory on StorageCard I can't put
> anything in it (e.g. with MoveFile() function). Also, can I change
> attributes of that newly created directory? Thanks for replying!
>
>
Post the code. Chances are you are doing something wrong

Re: CreateDirectory() won't work... by blue

blue
Sat Nov 19 08:29:17 CST 2005

> Post the code. Chances are you are doing something wrong

The code is below. Another problem is that Storage Card is, of course,
slower than RAM so the first IF executes the error message box (altough the
folder is created after moment or two, but NOT immediately - and that's why
IF executes the error message), so I'm wondering how can I slow down the
process for that moment or two? Something like 'pause the process for 0,3
sec and then continue'. Also, Mr. Feinman you've helped me in the other post
below ('enumerating SIP methods'), but I'm still experiencing some problems,
so if you're willing to take a quick look at that post below (the code is
written in it), because I can't find an example with SIP functions on the
web (on the Usenet neither). Thanks!

if(CreateDirectory(_T(\\Storage Card\\Directory),0)!=0){
AfxMessageBox(_T("Error!"),MB_OK|MB_ICONERROR);
return;
}

MoveFile(_T("\\Windows\\Example.exe"),_T(\\Storage
Card\\Directory\\Example.exe));


//So, directory is created but nothing is moved in it (because of the speed
of Storage Card I guess). Also, Resco File Explorer shows that directory has
attributes ReadOnly, ROM (?) and System. But if I mannually create Directory
and execute just MoveFile(), the problem remains. If the destination is just
"\\Storage Card" everything works out fine.



Re: CreateDirectory() won't work... by Michael

Michael
Sat Nov 19 09:19:15 CST 2005

The call to CreateDirectory is synchronous, so the directory will exist (or
you error out) on return.

You could be failing if the directory already exists.

You can't use MoveFile to move from one storage volume (RAM) to the other
(Storage Card). You have to use CopyFile (and then delete the original).

You should get specific error codes - they can be very useful in determining
the exact cause of the problem. Use GetLastError (but only if something
fails!).

--
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com


"blue" <blue@blue.blue> wrote in message
news:OwXx1ZR7FHA.3200@TK2MSFTNGP11.phx.gbl...
>> Post the code. Chances are you are doing something wrong
>
> The code is below. Another problem is that Storage Card is, of course,
> slower than RAM so the first IF executes the error message box (altough
> the folder is created after moment or two, but NOT immediately - and
> that's why IF executes the error message), so I'm wondering how can I slow
> down the process for that moment or two? Something like 'pause the process
> for 0,3 sec and then continue'. Also, Mr. Feinman you've helped me in the
> other post below ('enumerating SIP methods'), but I'm still experiencing
> some problems, so if you're willing to take a quick look at that post
> below (the code is written in it), because I can't find an example with
> SIP functions on the web (on the Usenet neither). Thanks!
>
> if(CreateDirectory(_T(\\Storage Card\\Directory),0)!=0){
> AfxMessageBox(_T("Error!"),MB_OK|MB_ICONERROR);
> return;
> }
>
> MoveFile(_T("\\Windows\\Example.exe"),_T(\\Storage
> Card\\Directory\\Example.exe));
>
>
> //So, directory is created but nothing is moved in it (because of the
> speed of Storage Card I guess). Also, Resco File Explorer shows that
> directory has attributes ReadOnly, ROM (?) and System. But if I mannually
> create Directory and execute just MoveFile(), the problem remains. If the
> destination is just "\\Storage Card" everything works out fine.
>



Re: CreateDirectory() won't work... by blue

blue
Sat Nov 19 09:59:18 CST 2005

> The call to CreateDirectory is synchronous, so the directory will exist
> (or you error out) on return.
> You could be failing if the directory already exists.

The folder doesn't exists, and it takes some time for it to be created on
Storage Card (and I get error message).

> You can't use MoveFile to move from one storage volume (RAM) to the other
> (Storage Card). You have to use CopyFile (and then delete the original).

Thanks for the tip, I got it worked now. Altough I was confuse because
MoveFile() have moved the files from RAM to \Storage Card without any
problems.

> You should get specific error codes - they can be very useful in
> determining the exact cause of the problem. Use GetLastError (but only if
> something fails!).

It's working now. Thanks once again!