|
|
#1 |
|
Junior Member
Join Date: Feb 2007
Location: Antwerpen, Belgium
Posts: 2
|
Copy file name truncated
Hi,
Following code extract produces two errors on my system: code: 1) The destination file name gets truncated to "backgrou.jpg" (and a second time to "backgrou (2).jpg"): the base name appears to be only eight bytes long. 2) The original file is not deleted. I don't manage to delete any file in the destination directory. What am I overlooking? Thanks for your help! Kristoff |
|
|
|
|
|
#2 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,917
|
Why are you using StrCmp? To see if the path exists? If so, try IfFileExists.
Also, never extra to say, try use full paths in CopyFiles. * PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2007
Location: Antwerpen, Belgium
Posts: 2
|
Hey, adding the path solves all these file related issues! I corrected the code with Joel's suggestion, and after success did the same in a cleaner way by renaming instead of copying.
Now the action in the code looks like this: code: The StrCmp function is used for performing the action only if the two file names differ from each other, and I delete a possible former installed target file before renaming the original file to the target file. With this strategy I choose one file (= PRODUCT_BACKGROUND_ORIG) from an available set of files to be installed as the specified target file (= PRODUCT_BACKGROUND). Thanks Joel! Kristoff |
|
|
|
|
|
#4 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,917
|
No problem
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|