Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #9217

Re: Copy and Rename issue

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 <ndjhfk$keb$1@dont-email.me>
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> <ndjhfk$keb$1@dont-email.me>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <8a94de3b-e504-44b2-aaae-47e947c3888a@googlegroups.com> (permalink)
Subject Re: Copy and Rename issue
From "Philippe Bayard (Belgium)" <philbayard@gmail.com>
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

Show key headers only | View raw


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 écrit :
> Jean-Philippe
> 
>     
> 
>     Have you tried creating the string with single quote ' and then use
>     the double quote " to contain the whole file name?
> 
>     
> 
>      SHRename('"' + WorkDir()+'TMP\'+ofs:FileName+ofs:Extension + '"' , '"' + WorkDir()+'TMP\'+ SysObject():cUsername +'_email.msg' + '"')
> 
>     
> 
>     HTH,
> 
>     
> 
>     
> On 2016/03/31 17:37, Philippe Bayard
>       (Belgium) wrote:
> 
>     
>     
>       Hi Everyone,
> 
> i have a very strange case there.
> 
> In one of our app, people can drop Outlook .msg file to add it to a document tab. Everything works like a charm until one of our user tried to drop a file with a specific name.
> 
> The file has the subject of the mail as name.
> 
> "1DXT684 - MAZDA MX-5 - LA ROCCA Marc - Ethias 2015020361 021 - Autopia #14016.msg"
> 
> 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...
> 
> And in our process, i must give this file to another exe which cannot handle file with a space in it.
> 
> I've tried everything i have in mind to rename it.
> 
> 1) FCopy 
> 
> Failed, my app start freezing and i can only stop is via the task manager.
> Same for FRename.
> 
> 2) SHCOPY + SHRENAME ( ~ SHFileOperation with FO_COPY and FO_RENAME )
> 
> SHCOPY works, SHRENAME not so i'm still not able to proceed it.
> Everything works fine with another file.
> 
> SHRename ( ShFileOperation ) return 114 ( 0x72 ) which means 
> 
> DE_MANYSRC1DEST	0x72	Multiple file paths were specified in the source buffer, but only one destination file path.
> 
> Here, i'm lost.
> 
>  SHRename( WorkDir()+"TMP\"+ofs:FileName+ofs:Extension , WorkDir()+"TMP\"+ SysObject():cUsername +"_email.msg")
> 
> There is only one file here !
> 
> My SHRename function :
> 
> FUNCTION SHRename( cFROM as STRING, cTO as STRING ) as LOGIC PASCAL
>  //http://msdn.microsoft.com/en-us/library/windows/desktop/bb759795%28v=vs.85%29.aspx
> 
>  LOCAL struSHFileOpStruct is _WINSHFILEOPSTRUCT
>  LOCAL lSuccess as LOGIC  
>  LOCAL lRet as int
> 
>  struSHFileOpStruct.pFrom  := StringAlloc( cFROM+_chr(0) )
>  struSHFileOpStruct.pTo    := StringAlloc( cTO+_chr(0) )
>  struSHFileOpStruct.wFunc  := FO_RENAME   
>  struSHFileOpStruct.fFlags := FOF_NOCONFIRMATION | FOF_SILENT             
> 
>  lRet := SHFileOperation( @struSHFileOpStruct ) 
>  lSuccess := (  lRet = 0 )
> 
>  CloseHandle(struSHFileOpStruct.hwnd)
>  MemFree(struSHFileOpStruct.pFrom)
>  MemFree(struSHFileOpStruct.pTo)
>  
>  RETURN lSuccess  
> 
> 
> CFrom = c:\pgmvo28\exe\carpack\TMP\1DXT684 - MAZDA MX-5 - LA ROCCA Marc - Ethias 2015020361 021 - Autopia #14016?.msg
> 
> CTo = c:\pgmvo28\exe\carpack\TMP\DEBUG_email.msg
> 
> 
> 3) COPYFILE 
> 
> Fails ( return false... )
> 
> 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...)
> 
> then FileSpec rename fails, no error in the Filespec:oErrorInfo.
> 
> 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 problem? ) will freeze the soft?
> 
> Any advice is welcome :)
> 
> Best regards,
> Jean-Philippe
> 
> 
> 
> 
>     
>     
> 
>     
> -- 
> 
>       Johan Nel
> 
>       Grafx Support Team (Vulcan.NET)
> 
>       George, South Africa
> 
>       
> 
>     
>   
>  
> 
>  
> 			
> 		This email has been sent from a virus-free computer protected by Avast. 
> www.avast.com

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Copy and Rename issue "Philippe Bayard (Belgium)" <philbayard@gmail.com> - 2016-03-31 08:37 -0700
  Re: Copy and Rename issue "Philippe Bayard (Belgium)" <philbayard@gmail.com> - 2016-04-01 00:18 -0700
  Re: Copy and Rename issue Sjonnie D <Sjonnied@gmail.com> - 2016-04-01 00:34 -0700
    Re: Copy and Rename issue "Philippe Bayard (Belgium)" <philbayard@gmail.com> - 2016-04-01 00:43 -0700
      Re: Copy and Rename issue D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2016-04-01 12:29 +0200
        Re: Copy and Rename issue "Philippe Bayard (Belgium)" <philbayard@gmail.com> - 2016-04-01 05:20 -0700
          Re: Copy and Rename issue "Philippe Bayard (Belgium)" <philbayard@gmail.com> - 2016-04-01 06:34 -0700
      Re: Copy and Rename issue "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2016-04-01 12:41 +0200

csiph-web