1. CopyFile and MoveFile

I guess all of you know these two simple API functions. I've used them in a
software that i'm building through the 2.1 version of euphoria, well when i use
simple paths they work perfectly ( for simple path i mean like "c:\sourcedir" or
"c:\destdir" for example )
but when i put complex paths like ones of where is retrieved the startup folder
or the recent folder
that usually are retrieved throguh the api functions dedicated the registry (
es.: regopenkey ) and that appears like "c:\windows...\recent" then these two
functions when i put such complex strings fails ofeten giving a code that means
that the path can't be retrieved but sometimes work to solve the problem i used a
cycle wail that after the copyfile or the movefile use the GetLastError function
and when it's ok exit the cycle but seems not a good programming method. Did you
experience such problems using complex paths in such api functions ? Any advices
for me ?

Thank you veyr much...

new topic     » topic index » view message » categorize

2. Re: CopyFile and MoveFile

Raznato Flaminio wrote:
> 
> 
> I guess all of you know these two simple API functions. I've used them in a
> software that i'm building through the 2.1 version of euphoria, well when i
> use simple paths they work perfectly ( for simple path i mean like
> "c:\sourcedir"
> or "c:\destdir" for example )
> but when i put complex paths like ones of where is retrieved the startup
> folder
> or the recent folder
> that usually are retrieved throguh the api functions dedicated the registry
> ( es.: regopenkey ) and that appears like "c:\windows...\recent" then these
> two functions when i put such complex strings fails ofeten giving a code that
> means that the path can't be retrieved but sometimes work to solve the problem
> i used a cycle wail that after the copyfile or the movefile use the
> GetLastError
> function and when it's ok exit the cycle but seems not a good programming
> method.
> Did you experience such problems using complex paths in such api functions ?
> Any advices for me ?
> 
> Thank you veyr much...

Hi there,

Did you check to see if you needed to enclose the paths in quotes?
Just a guess.

Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

 From "Black Knight":
"I can live with losing the good fight,
 but i can not live without fighting it".
"Well on second thought, maybe not."

new topic     » goto parent     » topic index » view message » categorize

3. Re: CopyFile and MoveFile

> I guess all of you know these two simple API functions. I've used them in=
 a software that i'm building through the 2.1 version of euphoria, well whe=
n i use simple paths they work perfectly ( for simple path i mean like "c:\=
sourcedir" or "c:\destdir" for example )
> but when i put complex paths like ones of where is retrieved the startup =
folder or the recent folder
> that usually are retrieved throguh the api functions dedicated the regist=
ry ( es.: regopenkey ) and that appears like "c:\windows...\recent" then th=
ese two functions when i put such complex strings fails ofeten giving a cod=
e that means that the path can't be retrieved but sometimes work to solve t=
he problem i used a cycle wail that after the copyfile or the movefile use =
the GetLastError function and when it's ok exit the cycle but seems not a g=
ood programming method. Did you experience such problems using complex path=
s in such api functions ? Any advices for me ?

Are these paths longer than 255 characters? If so, you'll need to use
the Unicode alternatives. Check out my win_dir in the Archive.

~Greg

new topic     » goto parent     » topic index » view message » categorize

4. Re: CopyFile and MoveFile

CopyFile and MoveFile should work with any valid filesystem path. I don't
believe they will work with quotes. Both source and destination may be relative
paths but both must include the filename. The complex paths you mention may or
may not include the trailing slash character '\'. It is always a good idea to
check and add it if necessary.

Larry Miller

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu