1. CopyFile and MoveFile
- Posted by Raznato Flaminio <temporaneo at hotmail.com> Apr 24, 2006
- 461 views
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...
2. Re: CopyFile and MoveFile
- Posted by Al Getz <Xaxo at aol.com> Apr 24, 2006
- 459 views
- Last edited Apr 25, 2006
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."
3. Re: CopyFile and MoveFile
- Posted by "Greg Haberek" <ghaberek at gmail.com> Apr 24, 2006
- 449 views
- Last edited Apr 25, 2006
> 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
4. Re: CopyFile and MoveFile
- Posted by Larry Miller <larrymiller at sasktel.net> Apr 24, 2006
- 454 views
- Last edited Apr 25, 2006
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