Results 1 to 4 of 4

Thread: Moving files and leaving links behind

  1. #1
    Join Date
    Jan 2009
    Location
    Washingtion, USA
    Beans
    27
    Distro
    Ubuntu 9.10 Karmic Koala

    Moving files and leaving links behind

    Hi I was wondering if anybody knows of a way to move a file that is being written to at the same time and leave a sym link pointing to the new location for the app writing to the file.

    When my Firefox plugin starts downloading a file into the /tmp directory I would like to be able to move the file some where else without waiting till it finishes.
    AMD Phenom X6 1055T 6-Core 2.8Ghz, 8GB RAM, 300GB HD, PNY Nvidea GeForce 9800GT 512MB

  2. #2
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,505
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Moving files and leaving links behind

    Quote Originally Posted by samuelhug View Post
    Hi I was wondering if anybody knows of a way to move a file that is being written to at the same time and leave a sym link pointing to the new location for the app writing to the file.

    When my Firefox plugin starts downloading a file into the /tmp directory I would like to be able to move the file some where else without waiting till it finishes.
    Why not just get Firefox to prompt you to put the file where you actually want it?
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  3. #3
    Join Date
    Feb 2007
    Beans
    4,045
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Moving files and leaving links behind

    If it's on the same filesystem, you can move a file while its being written to, and it will not interrupt the writing. A filename itself is just a link (hardlink) to the file's inode, and the hardlink is only needed when opening the file, to find the right inode.

  4. #4
    Join Date
    Jan 2009
    Location
    Washingtion, USA
    Beans
    27
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Moving files and leaving links behind

    Wow thanks geirha I can't believe it was that simple.
    AMD Phenom X6 1055T 6-Core 2.8Ghz, 8GB RAM, 300GB HD, PNY Nvidea GeForce 9800GT 512MB

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •