Relocating a Single File

Discussion in 'Mac OS X Lion (10.7)' started by haravikk, Mar 25, 2012.

  1. haravikk macrumors 65816

    Joined:
    May 1, 2005
    #1
    This is a slightly annoying problem; basically, since I've switched to an SSD I've relocated most areas of the system that are frequently written to such as caches etc., either into a RAM disk, or onto a separate drive, in an attempt to focus my SSD on read-spead improvements.

    Anyway, one of the problem cases that has come up is Intego Virusbarrier, as it blatantly misuses its folder in /Library/Preferences by storing non-preference related data such as a "Buffer" file that it uses while scanning. Aside from the fact that this is another example of them doing something the wrong way (it should be in /Library/Caches, or not a file at all since it's never more than a few megabytes anyway), it's a file that's written to very heavily during scans, so I'd like to move it.

    However, I don't really want to move the entire folder. The problem with this is that if I use a symbolic link to move only the problem file(s), then VirusBarrier simply overwrites the symbolic link and creates a new file in that location; a common enough problem with symbolic linking of single files.

    So what I'm wondering is what is the best method to relocate a single file, is a hard-link the only option? I'd of course rather avoid a hard-link if at all possible, but I can't think of any alternative.
     
  2. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #2
    Why do you need Intego VirusBarrier? You could use ClamXAV instead, which is less invasive and might be easier to relocate*.
    Currently there are zero viruses affecting Mac OS X in public circulation, but there are other kinds of malware existing, that can infect your Mac.
    But as long as you don't install software from unknown and untrusted sources, you are safe, as malware needs administrative permissions to run successfully, which means, you need to install the malware yourself, it can't install itself (one of the reasons, why a Mac OS X virus hasn't appeared yet).
    To learn more about malware in Mac OS X and what steps can be taken to protect yourself, read the following F.A.Q.:
    Mac Virus/Malware Info by GGJstudios
    The above F.A.Q. includes the following topics:
    • Malware terminology - What is the difference between viruses, worms, and Trojans?
    • Antivirus apps
    • What security steps should I take?
    • What about sending files to Windows users?
    • Why am I being redirected to other sites?
    • Recent threats in the news


    * Have you seen any performance increase with relocating all those files? Because those system accesses (read and write) are most often rather small to seriously slow down the SSD access times (due to its very fast random access times).
     
  3. haravikk thread starter macrumors 65816

    Joined:
    May 1, 2005
    #3
    Not really the answer I was looking for :p
    I've used ClamXav and hated it and, while I'm generally very careful what I install, I'd rather not take chances, especially since I deal with a lot of Windows users (and have a Windows Bootcamp/VM installed) so I prefer to avoid unintentionally spreading any potential malware to those other OSes as well.

    Anyway, it's besides the point really, I'm happy to run VirusBarrier, they just need to fix some of the weirder decisions they've made with it. In the mean time, I just need to know how to relocate a couple of files :)
     
  4. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #4
    I would not recommend trying to move/relocate the files that the app relies on. It doesn't matter if Virusbarrier "blatantly misuses its folder in /Library"

    Its written to use that location and any attempt to circumvent that may cause problems.

    Why does the location of Virusbarrier's files that it uses matter? I'm not sure why this is an issue?
     
  5. haravikk thread starter macrumors 65816

    Joined:
    May 1, 2005
    #5
    Because /Library/Preferences is on my SSD, and I want to minimise writing to it as much as possible. Normally this is fine as preferences files shouldn't be written to very often as their purpose is persistent data, but VirusBarrier's "Buffer" file is only used temporarily as a cache, so I'd like to move it to the same location as other cache type data.

    I don't want to move the file, at least not in the normal sense, I want to redirect VirusBarrier so instead of writing to the file in /Library/Preferences it will do so elsewhere instead. This is what I normally use symbolic links for, but it only really works for whole folders, as if you use it for a file then most apps will just overwrite the link.
     
  6. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #6
    But you're trying to circumvent the applications normal behavior and trying to create a symlink failed. There's really no other way around this, short of not using the application.
     
  7. Bear macrumors G3

    Joined:
    Jul 23, 2002
    Location:
    Sol III - Terra
    #7
    If it's putting a file in the wrong place, contact Intego and discuss it with them. It sounds like the file you say doesn't belong in preferences actually belongs under either ~/Library/Application Support or ~/Library/Caches - get the software fixed, don't just work around it.
     
  8. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #8
    Problem #1: You have VirusBarrier installed. You absolutely don't need it. As for sharing files with Windows, read this:
    If you insist on running antivirus, ClamXav is one of the best choices, since it isn't a resource hog, detects both Mac and Windows malware and doesn't run with elevated privileges. You can run scans when you choose, rather than leaving it running all the time, slowing your system.

    You don't need any 3rd party antivirus app to keep your Mac malware-free. Macs are not immune to malware, but no true viruses exist in the wild that can run on Mac OS X, and there never have been any since it was released over 10 years ago. You cannot infect your Mac simply by visiting a website, unzipping a file, opening an email attachment or joining a network. The only malware in the wild that can affect Mac OS X is a handful of trojans, which cannot infect your Mac unless you actively install them, and they can be easily avoided with some basic education, common sense and care in what software you install. Also, Mac OS X Snow Leopard and Lion have anti-malware protection built in, further reducing the need for 3rd party antivirus apps.
    The wisest approach is to uninstall VirusBarrier.

    Problem #2: You're moving folders related to app operation. Your /System, /Library, /Applications, ~/Library, etc. folders should all be on your boot device. Moving these folders to other than the default locations can cause apps to fail to operate or update properly. You're better off moving user files and leave system and app-related folders alone.
     
  9. haravikk thread starter macrumors 65816

    Joined:
    May 1, 2005
    #9
    Look, no offence, but I don't need to be lectured about my choice of antivirus software and what I'm trying to do; I am perfectly aware of all the issues involved and am happy with my decisions.

    What is clear however is that hard-linking seems to be the only way to achieve what I want, so I've done it that way and everything's working fine.

    Of course, hard-linking, unlike symbolic-linking, doesn't work across devices. This fine with a bit of trickery, since I've been moving high-write caches into RAM disks anyway, so once the file is relocated and hard-linked from a suitable location on disk, I can happily use 'mount -o union' to capture writes into RAM and off my SSD. It's stupidly complicated, but it eliminates a lot of annoying write activity without breaking the program, so it's what I wanted :)
     
  10. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #10
    You're not being lectured. You came here asking for advice. We gave you sound advice. If you don't want to follow it, that's your choice, but if you don't like the answers, don't ask the questions.
     
  11. KnightWRX macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #11
    I'll go with the family and say you're over-complicating things with no benefit at all. The answer here is simple : Get rid of the useless piece of software you don't need to be running instead of trying to fix it.
     
  12. haravikk thread starter macrumors 65816

    Joined:
    May 1, 2005
    #12
    That'd be a great sentiment, except that I didn't ask either of the questions that you answered. I'm perfectly happy to be using VirusBarrier, because I'm not naïve enough to think that good practice alone is enough to protect my system, and I've already tried ClamXav and several other anti-virus solutions and not liked them.

    Nor was I asking whether or not I should move the file, as I've moved plenty of things like it already without ill effect. The problem was that everything else I've moved has been a folder, in which case a symbolic link is usually fine, or a file-system image can be mounted directly onto it.

    Obviously it was a mistake to give context as to the particular case I was seeking to address, as all I wanted was to confirm whether hard-linking was the only actual option.
     
  13. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #13
    [MOD NOTE]
    the OP did not ask about the pros/cons on virus software. He's asking how that one app is behaving. Lets stay on topic.
     

Share This Page