English
Forum

Copy and UNC paths

 
Crazy I or could Copy  time of UNCs ala \serverfolderfile copy - what now with X10 not any more goes?! Perhaps. wg. the innovation since X9 with the Dateiattributen?

FileExists  and assign  against having no trouble...
 
10/25/06  
 




RGH
During I former whom copy in Delphi self written having, so use I because of the Attributgeschichte since 9.x The windows-API. the likes these Änderung explain.
with Assign, etc. building I still on solide needlework. ;) therefore should You with BlockRead/BlockWrite a Zweizeiler hinbekommen, the the copy with middle-aged qualities (and Unzulänglichkeiten concerning the attributes) hinbekommt.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
10/25/06  
 



Jupp Have I Have me strain this NEN fcopy written:
CompileMarkSeparation
proc fcopy(from$,to$)

    casenot fileexists(from$) : return false
    var fmode&:=get("FileMode")
    set("FileMode",2)
    var fh&:=assign(from$)

    if fh&

        openrw fh&
        var siz&:=getfilesize(fh&)

        if siz&

            declare mem#
            dim mem#,siz&
            var bytesRead&:=blockread(fh&,mem#,0,siz&)
            closerw fh&
            fh&:=assign(to$)
            openrw fh&
            blockwrite fh&,mem#,0,bytesRead&
            closerw fh&
            dispose mem#

        else

            closerw fh&
            fh&:=assign(to$)
            openrw fh&
            closerw fh&

        endif

        assign fh&,""

    endif

    set("FileMode",fmode&)
    return true

endproc

Klappt now again fine.

<offtopic>
CompileMarkSeparation
proc FCOPY

    PARAMETERS FROM$,TO$

    IFNOT FILEEXISTS(FROM$)

        RETURN 0

    ENDIF

    VAR FMODE&=GET("FileMode")
    SET("FileMode",2)
    VAR FH&=ASSIGN(FROM$)

    IF FH&

        OPENRW FH&
        VAR SIZ&=GETFILESIZE(FH&)

        IF SIZ&

            DECLARE MEM#
            DIM MEM#,SIZ&
            VAR BYTESREAD&=BLOCKREAD(FH&,MEM#,0,SIZ&)
            CLOSERW FH&
            FH&=ASSIGN(TO$)
            OPENRW FH&
            BLOCKWRITE FH&,MEM#,0,BYTESREAD&
            CLOSERW FH&
            DISPOSE MEM#

        ELSE

            CLOSERW FH&
            FH&=ASSIGN(TO$)
            OPENRW FH&
            CLOSERW FH&

        ENDIF

        ASSIGN FH&,""

    ENDIF

    SET("FileMode",FMODE&)
    RETURN 1

endproc

</offtopic>
 
10/25/06  
 




RGH
... and the advanced Funktionalität of XProfan 10 for BlockWrite/BlockRead goes it yet dfeutlich kürzer with exakt same Funktionalität:
CompileMarkSeparation
!Proc fcopy
parameters from$,to$
CaseNot FileExists(from$) : Return 0
Var siz& = FileSize(from$)
Case siz& = 0 : return 0
Declare mem#
Dim mem#,siz&
Var bytesRead& = BlockRead(from$, mem#, 0, siz&)
BlockWrite to$, mem#, 0, bytesRead&
Return 1

c

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
10/25/06  
 



Dim mem#,0 lead still but to that crash... ^^

somehow faith I nevertheless me with eachone row of my Programmierungen something thereby virtual to have ^^

The Set-skilful have You too except eight let - are The endeavours in of my Proc unnütz?

your FCopy is dank the new XProfan10-Funktionalitäten (which I well first any yet inne having must) nevertheless schicker.
 
10/25/06  
 




Jörg
Sellmeyer
Have I now really something missed?
CompileMarkSeparation
Var siz& = FileSize(from$)
>

David has the Var already often using what about me thought, the be one XPSE-feature.
but ifs the Scheff yourself already using
The Help says anyway nothing moreover...
Greeting
Jörg
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
10/25/06  
 



The proof of the pudding is in the eating.
 
10/25/06  
 




RGH
[quote:c5a4b2e81b=iF]Dim mem#,0 lead still but to that crash... ^^[/quote:c5a4b2e81b]
the ought to of course not to that crash lead, but I erweitere my code supra properly.

[quote:c5a4b2e81b]The Set-skilful have You too except eight let[/quote:c5a4b2e81b]
have I do not. Related to the Filemode power but already BlockRead self.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
10/25/06  
 



you mean one Block Write writes even if before one only reading with Set(FileMode... staid is?
 
10/25/06  
 




RGH
[quote:3bb5d4f872=iF]you mean one Block Write writes even if before one only reading with Set(FileMode... staid is?[/quote:3bb5d4f872]
Yes, BlockWrite(File) setting whom Filemode temporär on 2 and subsequently again back.
with BlockRead(File) set I it though on only reading, circa too schreibgeschützte Files reading to!

Nachtrag: This is naturally only whom mutants, where it circa whole Files goes! otherwise must the FileMode of Programmer staid go, before it The File me OpenRW opens.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
10/25/06  
 



OK understand.

your obiges example is still not integrally correctly ^^ - Files with the Size of 0 byte go not copies... *duck*
 
10/25/06  
 




Jörg
Sellmeyer
[quote:1fed0361f8=iF]The proof of the pudding is in the eating. [/quote:1fed0361f8]
is the what Geheimes or what?
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
10/25/06  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.717 Views

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie