in reply to How to sync a UNC path to a USB memory stick in Windows?

OfficeLinebacker:

The only thing I can think of is: Since you're using File::Find to traverse the directory tree to delete, why not just change the logic to use File::Find on the source drive, and then build the directory structure in the same way you're tearing it down. Then you can omit the xcopy...

Regarding cut & paste to/from the DOS window: What works for me (Windows 2000 Professional) is to right-click the title bar of the DOS app, and select Edit->Mark, then use the mouse to highlight text and press the Enter key. That puts it on my clipboard so I can paste with ^V in *real* applications... 8^). I dunno if it'll work for you, but maybe it will.

--roboticus

  • Comment on Re: How to sync a UNC path to a USB memory stick in Windows?

Replies are listed 'Best First'.
Re^2: How to sync a UNC path to a USB memory stick in Windows?
by OfficeLinebacker (Chaplain) on May 31, 2006 at 02:39 UTC
    Hey, buddy, thanks for replying!

    OK, I'll have to play with File::Find and see if it will take UNC arguments. Also, if File::Find will, then would it be logical to assume File::Copy would, too? And doesn't File::Copy have a recursive add-on?

    I happen to be home right now and I got to poking around on my laptop, and whatddya know, someone has written a perl script that maps drives when you're away from the office. Seems fairly simple in that it uses 'net use.' So I may look into that as well.

    Thanks again,

    J

    UPDATE: Also File::Repl looks interesting and appears to work with UNCs.

    _________________________________________________________________________________

    I like computer programming because it's like Legos for the mind.

      I think File::Copy handles UNC paths. (In the cygwin perl (the one I use) I believe that filename resolution is ultimately passed on to the OS, so it has access to all the files the OS does.)

      I don't know about the recursive add-on, but I figure while you're doing your File::Find, your original routine has access to the full path of the filename. Given that, you could copy it over to the destination device.

      --roboticus

Re^2: How to sync a UNC path to a USB memory stick in Windows?
by ww (Archbishop) on May 31, 2006 at 13:07 UTC
      "right-click the title bar of the DOS app, and select Edit->Mark, then use the mouse to highlight text and press the Enter key.

    Save some steps:
    Once the DOS window has focus, there's no need to select edit. Just use the mouse to highlight the text to copy to the clipboard and hit enter when the highlighting is complete. NB: you can take a set of columns, but to capture continuous text, you'll need to be careful to highlight the full (virutal) width of the DOS screen... and when chars/line > 256, you'll have to replace the lineendings in the copy you "paste with ^V in *real* applications...."

    That begs another question -- nay, "a mystery" to me: why did M$ bother with the "mark" option at all?

    Update Re Roboticus' below: I'm stuck (this week) with w2k... and somewhat surprised by the question, since above ( in [id://#552678] ) you remarked "What works for me (Windows 2000 Professional) ...."
      What version of Windows are you using? I'm on Windows XP Professional 2002, and I can't select text with the mouse until I do the Edit->Mark. Ah, well, chalk it up to another inconsistency between versions of Windows.

      (And to think that people complain about minor variations of various versions of *nix...)

      --roboticus

        Thats because you have not enabled "quick edit mode".

        Click the system menu on a console window(top left), then Properties->Options->QuickEditMode. Then you'll be able to drag mark using the left button, copy with the right (when marked), and paste with the right button (when there is something in the paste buffer).

        When you click OK, you'll be offered the choice to enable it for just this window, or for all console windows.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.