revCopyFile slow?
Maarten Koopmans
maarten.koopmans at gmail.com
Sun Apr 10 07:36:55 EDT 2011
Yes, but a simple rev implementation should be as fast and
cross-platform (windows.... Mobile.....)
On Sunday, April 10, 2011, Web Admin Himalayan Academy <katir at hindu.org> wrote:
> On 4/8/11 6:25 AM, Maarten Koopmans wrote:
>
> I'll just write a copyfile function in LC then. That should be near-C
> speed, assuming open/read/write are implemented close to the os.
>
> Thanks, Maarten
>
> I would second Mark's option to use shell, I have a complete in-house version control system for InDesign files that runs pretty much entirely using cp and mv .
>
> These all run about as fast as the network and disk I/0 can handle...
>
> e.g.
>
> command Checkout pFileName
>
> CheckServerIsMounted
>
> if the uServerMounted of this stack <> "true" then
> answer "Sorry, Server is not mounted, you cannot check out files." with "OK"
> exit to top
> end if
> # Make a copy in Versions Archive
> put (the uServerProjectPath of this stack) &"/"& pFileName into tCurrentLocationPath
> put tCurrentLocationPath into tArchivePath
> set the itemDelimiter to "/"
> put "/Versions Archive" after item 5 of tArchivePath
> put ("cp " & quote & tCurrentLocationPath & quote &" "& quote & tArchivePath & quote) into tShell
> get shell (tShell)
>
> # update Control string and rename the top level file
>
> put the uUserInitials of this stack into char -7 to -6 of pFileName
> replace "-ci-" with "-co-" in pFileName
> put (the uServerProjectPath of this stack) &"/"& pFileName into tNewNamePath
> put ("mv " & quote & tCurrentLocationPath & quote &" "& quote & tNewNamePath & quote) into tShell
> get shell (tShell)
>
> # Copy to local folder
> put gLocalProjectPath &"/"& pFileName into tNewLocalPath
> put ("cp " & quote & tNewNamePath & quote &" "& quote & tNewLocalPath & quote) into tShell
> get shell (tShell)
>
> # update GUI now
>
> LoadVersionFiles gCurrentProject
>
> # boot InDesign and edit
>
> launch (tNewLocalPath) with (the uInDesignPath of this stack) # expand to handle other file types
>
>
> end Checkout
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list