X-Received: by 10.157.32.47 with SMTP id n44mr1974383ota.45.1459495082924; Fri, 01 Apr 2016 00:18:02 -0700 (PDT) X-Received: by 10.50.176.201 with SMTP id ck9mr28081igc.0.1459495082847; Fri, 01 Apr 2016 00:18:02 -0700 (PDT) Path: csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nt3no6548287igb.0!news-out.google.com!u9ni57igk.0!nntp.google.com!nt3no6548285igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.clipper.visual-objects Date: Fri, 1 Apr 2016 00:18:02 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.183.222.54; posting-account=pcZRYwoAAACX0IZzeMmUi9bC5Lel-t17 NNTP-Posting-Host: 91.183.222.54 References: <4e7739c9-396c-4a91-8767-7763e8a8e4a4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <8a94de3b-e504-44b2-aaae-47e947c3888a@googlegroups.com> Subject: Re: Copy and Rename issue From: "Philippe Bayard (Belgium)" Injection-Date: Fri, 01 Apr 2016 07:18:02 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 5268 X-Received-Body-CRC: 422835200 Xref: csiph.com comp.lang.clipper.visual-objects:9217 Dear Johan, Thank for the idea, but unfortunately, it doesn't work. Still the return code 114 for SHFileOperation Le jeudi 31 mars 2016 18:02:00 UTC+2, Johan Nel a =E9crit=A0: > Jean-Philippe >=20 > =20 >=20 > Have you tried creating the string with single quote ' and then use > the double quote " to contain the whole file name? >=20 > =20 >=20 > SHRename('"' + WorkDir()+'TMP\'+ofs:FileName+ofs:Extension + '"' , '= "' + WorkDir()+'TMP\'+ SysObject():cUsername +'_email.msg' + '"') >=20 > =20 >=20 > HTH, >=20 > =20 >=20 > =20 > On 2016/03/31 17:37, Philippe Bayard > (Belgium) wrote: >=20 > =20 > =20 > Hi Everyone, >=20 > i have a very strange case there. >=20 > In one of our app, people can drop Outlook .msg file to add it to a docum= ent tab. Everything works like a charm until one of our user tried to drop = a file with a specific name. >=20 > The file has the subject of the mail as name. >=20 > "1DXT684 - MAZDA MX-5 - LA ROCCA Marc - Ethias 2015020361 021 - Autopia #= 14016.msg" >=20 > The problem is that VO is unable to FCOPY this file. With a SHCOPY, i can= somehow move it, but i'm unable to rename it... >=20 > And in our process, i must give this file to another exe which cannot han= dle file with a space in it. >=20 > I've tried everything i have in mind to rename it. >=20 > 1) FCopy=20 >=20 > Failed, my app start freezing and i can only stop is via the task manager= . > Same for FRename. >=20 > 2) SHCOPY + SHRENAME ( ~ SHFileOperation with FO_COPY and FO_RENAME ) >=20 > SHCOPY works, SHRENAME not so i'm still not able to proceed it. > Everything works fine with another file. >=20 > SHRename ( ShFileOperation ) return 114 ( 0x72 ) which means=20 >=20 > DE_MANYSRC1DEST 0x72 Multiple file paths were specified in the source buf= fer, but only one destination file path. >=20 > Here, i'm lost. >=20 > SHRename( WorkDir()+"TMP\"+ofs:FileName+ofs:Extension , WorkDir()+"TMP\"= + SysObject():cUsername +"_email.msg") >=20 > There is only one file here ! >=20 > My SHRename function : >=20 > FUNCTION SHRename( cFROM as STRING, cTO as STRING ) as LOGIC PASCAL > //http://msdn.microsoft.com/en-us/library/windows/desktop/bb759795%28v= =3Dvs.85%29.aspx >=20 > LOCAL struSHFileOpStruct is _WINSHFILEOPSTRUCT > LOCAL lSuccess as LOGIC =20 > LOCAL lRet as int >=20 > struSHFileOpStruct.pFrom :=3D StringAlloc( cFROM+_chr(0) ) > struSHFileOpStruct.pTo :=3D StringAlloc( cTO+_chr(0) ) > struSHFileOpStruct.wFunc :=3D FO_RENAME =20 > struSHFileOpStruct.fFlags :=3D FOF_NOCONFIRMATION | FOF_SILENT = =20 >=20 > lRet :=3D SHFileOperation( @struSHFileOpStruct )=20 > lSuccess :=3D ( lRet =3D 0 ) >=20 > CloseHandle(struSHFileOpStruct.hwnd) > MemFree(struSHFileOpStruct.pFrom) > MemFree(struSHFileOpStruct.pTo) > =20 > RETURN lSuccess =20 >=20 >=20 > CFrom =3D c:\pgmvo28\exe\carpack\TMP\1DXT684 - MAZDA MX-5 - LA ROCCA Marc= - Ethias 2015020361 021 - Autopia #14016?.msg >=20 > CTo =3D c:\pgmvo28\exe\carpack\TMP\DEBUG_email.msg >=20 >=20 > 3) COPYFILE=20 >=20 > Fails ( return false... ) >=20 > 4) FileSpec + Filespec:Rename()ofs: > FileSpec Works ( FileSpec:filename gives "1DXT684 - MAZDA MX-5 - LA ROCCA= Marc - Ethias 2015020361 021 - Autopia #14016?" with a "?" coming from no= where...) >=20 > then FileSpec rename fails, no error in the Filespec:oErrorInfo. >=20 > Does someone has an idea about how i can manage this? > Does this mean that any Fcopy with a long name (or is it the # the proble= m? ) will freeze the soft? >=20 > Any advice is welcome :) >=20 > Best regards, > Jean-Philippe >=20 >=20 >=20 >=20 > =20 > =20 >=20 > =20 > --=20 >=20 > Johan Nel >=20 > Grafx Support Team (Vulcan.NET) >=20 > George, South Africa >=20 > =20 >=20 > =20 > =20 > =20 >=20 > =20 > =09 > This email has been sent from a virus-free computer protected by Avast.= =20 > www.avast.com