Can a file be moved?

The Question:
Is there any way of checking whether or not a file can be moved?
The Context
My program is periodically checking a folder for new files. Files are moved into this folder via FTP. My program is designed to then move these files into a different folder. However, I want to ensure that the file has completely arrived.
The Example
For example, a 450MB file will appear to the Java File API, but I won't be able to move it if the file is still copying over.
The Restrictions
I know you can check the success/failure of a move - I don't want to do this (Althought it looks like I'll have no choice).
The results of File.canRead() and File.canWrite() don't help.
I don't want to do nasty tricks like monitoring the file's size over the course of a minute to see if it has stopped increasing.

So? I can personally guarantee that if the operation you are attempting fails, it did not succeed, regardless of the platform ;-)
And the question isn't whether the file is being copied to, it's whether it can be moved.
So move it.
It's like these people who want to see whether a host is reachable before they try to connect to it. Just do the connect!
Any other approach to this sort of problem and you are trying to predict the future. You are fortune-telling.

Similar Messages

  • Can't open Numbers file after moving it back to Mac from Dropbox

    Please help!  Can't open Numbers file after moving it back to iMac from Dropbox.   Says I need the newer version of Numbers each time I tried to open the file.  I am 100% sure that I had the newest version.   Spoke to the AppleCare guy and after doing the checks he is also sure that I had the latest version of Numbers and AppleCare can't help.  He suggested that maybe i should run it on a file repair program...any suggestion?... please help...

    I've read reports of people having trouble when storing Numbers 3 documents on Dropbox.  I think it's related to the fact that they're not really "files."  They're "packages" that look like files. I had thought that Dropbox had cleared this up with their latest update. You should be on Dropbox version 2.4 or later.
    If you have Time Machine you may have some luck going back in time and restoring the document from a previous version.
    Storing Numbers documents on iCloud works much better, at least for me, and (unlike Dropbox) iCloud facilitates automatic syncing to other Macs and iOS devices signed into the same Apple ID.
    Perhaps you could consider keeping Numbers documents in iCloud instead. iCloud is deeply integrated into the app, and now works well.
    SG

  • I tried to encrypt using file vault but it froze slowing my macbook pro, how can i get things moving or stop the encryption

    i tried to encrypt using file vault but it froze slowing my macbook pro, how can i get things moving or stop the encryption

    Back up all data before proceeding. There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    Start up in Recovery mode. When the OS X Utilities screen appears, select Disk Utility.
    In the Disk Utility window, select the icon of the startup volume from the list on the left. It will be nested below another disk icon, usually with the same name. Click the Unlock button in the toolbar. When prompted, enter the login password of a user authorized to unlock the volume, or the alternate decryption key that was generated when you activated FileVault.
    Then, from the menu bar, select
              File ▹ Turn Off Encryption
    Enter the password again.
    You can then restart as usual, if the system is working. Decryption will be completed in the background. It may take several hours, and during that time performance will be reduced.
    If you can't turn off encryption in Disk Utility because the menu item is grayed out, you'll have to erase the volume and then restore the data from a backup. Select the Erase tab, and then select
              Mac OS Extended (Journaled)
    from the Format menu.
    You can then quit to be returned to the main Recovery screen. Follow these instructions if you back up with Time Machine. If you use other backup software, follow its developer's instructions.
    Don't erase the volume unless you have at least two complete, independent backups. One is not enough to be safe.

  • [tools help] what tool can be used for moving file?and table row updating?

    I need some help to know which tool can help me in the following task:
    #1 Moving of file
    situation : After extraction of a file , the file is moved to another directory.
    #2 SQL updating
    Situation : which tool in mapping can be used to update existing record / perform sql
    such as UPDATE SET VALUE TABLE WHERE .... or DELETE...

    I need some help to know which tool can help me in the following task:
    #1 Moving of file
    situation : After extraction of a file , the file is moved to another directory.You can move the file using oracle UTL_FILE Package Seach the net with this Key word and create procedure/ function in oracle test it in Database .Once everything is perfect then call the procedure/function form OWB
    #2 SQL updating
    Situation : which tool in mapping can be used to update existing record / perform sql
    such as UPDATE SET VALUE TABLE WHERE .... or DELETE...Set the Load properties of the target table as Update or Delete

  • Can't find files I "moved" to iCloud from Preview

    I simply opened the PDF files then "moved" them to iCloud.  I open iCloud and don't see where I could find them.  I checked my System Preferences for iCloud and more options seem to appear there than are available online... I'm confused.
    K

    When I "moved" them, I opened them from my desktop in Preview and when the command was complete, they were no longer on my desktop!  I still have the files that arrived in an email account - I'll likely forward those to my cloud account and just do that in the meantime. 
    It is a bit odd that we wouldn't have access to stuff that clearly was moved to the cloud...
    Thanks for your help

  • Hyperlinks from converted excel file are not working after pdf file is moved

    I have created a pdf file from an excel file that has hyperlinks in it. The hyperlinks work fine if the files are all kept in the same exact location as the time they were created. Once the files are moved (i.e. emailed to another user) the hyperlinks no longer work. An error message pops up that the file can not be found. Is there a setting or something that I'm missing in acrobat that allows for the files to be moved, so that the hyperlinks still function properly, after creation

    No settings adjustments.
    The issue is that links, once made, have a specific path (as shown when you view the link's text string).
    When you email the files the person who recieves the email and downloads the attachments would have to have the same layout of files/folders you have.
    Without that links are "broken"
    You email a zip file that, when extracted, would create the folders/files in the required layout to reflect what you have.
    Be well...

  • Problem in tutorial and zip file. can anyone file it or correct it..

    hi jdev experts,
    am using jdev11.1.1.5.0.
    when am new to these webservice. i followed this tutorial
    http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_14/jdtut_11r2_14.html
    url wsdl link when use that wsdl.
    throws some error.
    what is the reason john says. ok at second post of the thread.
    Consuming a Web Service from a Web Page
    so if i change the wsdl means and somethings has to be changed in tutorial steps.
    if any newbie crossing this tutorials feels very difficult to work. so can change the wsdl url link and those steps.
    and another thing I installed 11.1.2.0 and download that zip file in that tutorial and i run throws the same error.
    so. problem in tutorial and zip file. can anyone file or correct..
    i think think this is the right place to tell this. or else re-direct me.

    this is to arun.
    As the exception stack clearly mentions that the endpoint is moved, it is up to the users to make use of any other webservice.trace says link is moved i know.
    thing am here is:
    please make note on that tutorials.
    * note :- just like this consume some other external webservices. dont use this webservice this webservices link is broken.
    this what saying.
    this to john.
    thanks. thanks again.

  • Once an iBook has been exported to the iPad, how can that book be moved to a different iPad or back to iBooks Author?

    Once an iBook has been exported to the iPad, how can that book be moved to a different iPad or back to iBooks Author?

    You can't simply move it directly between iPads.
    In your example, you'd find that .ibook file in your iTunes account on your computer and then email or sync it to the school's iPad. Similar to how you did with yours....maybe you got it off a server and can repeat that process.
    Then delete it off your iPad and either delete or flag your copy in iTunes to not be put back when you sync in the future.

  • Problem with missing files after moving folders around

    Hi,
    I keep my music files manually organized. This is mostly because I have a LOT of music and I don't want to take up all the space on my MBP HD. So my music is split up between 2 external drives and the MBP drive.
    I was moving around some folders since I wanted to reorganize my music folders, and iTunes can't seem to find the files anymore, and in order to fix it I see I need to find each and every file I moved (which is really not practical).
    I tried editing the "iTunes Music Library.xml" file, but it seems to get rebuilt from some other place where this information is stored.
    I also tried putting aliases in the old folders' locations pointing to the new ones (iTunes kept saying the files are missing)
    Is there any way to simplify the process of moving folders?? This is really strange that such a feature is missing.
    Thanks
    Yaron

    If you have the 'keep' option enabled and let iTunes do the work - take a sound track album as an example - that has various artists and you didn't tell iTunes that the album was a compilation album - then iTunes will put all the tunes into into the iTunes Music folder as Artist>Album>Song - if you have the compilation option enabled for the tunes on that same album - iTunes will nest it as iTunes Music>Compilation>Album>Song. This helps reduce the clutter in the iTunes Music folder with a thousand artists and only one tune for that artist.
    With the 'keep' option selected iTunes will move tunes automatically within the iTunes Music folder. Since iTunes moved the files it can keep track of the links.
    To create a second library launch iTunes with the 'option' key down and follow the dialog box instructions. I have a 'Master iTunes Library' on my internal HD and several ext HD's with other libraries which I give unique names i.e.: Really Big Music. I give the library data base file its' own unique name so I don't accidentally erase the wrong file. I also keep all the files that you would normally see for an iTunes library on the ext HD (iTunes library. .xml, art work etc.,). If you are into lots of movies and TV Shows you could create a library on and ext HD with only video content and name it accordingly. You would keep all the files for that library including the library 'management' files on the ext HD in the same nesting as you would find on your internal HD.
    This strategy works for me. I tried to manage the files by myself at one point and just had to many problems so I decided to not fight City Hall and go with the flow and it works for me.
    MJ

  • Help please, spacific file update only changed files when moved

    I record live bands and file size can be very large when i make changes to files i want to save time and resources by only updating what has changed without replacing the whole file. when moving files from desktop to external drive.
    say i have a file named "jam" that i add files to on my external drive then i copy it to my internal drive, do some edditing and add some files. when i move it back to external drive i want to update the "jam" file add the new files and changed files without having to keep track of the changed files and not transfer the files that havent changed. can anyone help?

    Only files and folders below directory "/emmc" will show up in windows explorer.
    You will also not be able to edit (add/delete) files to the /system/media/audio/notifications folder (or just about any folder above /emmc) . This is because you do not have administrator access (for lack of a better term) to the phone.
    So, if it's that important to you, you'll have to find a way to tell the phone you're an administrator
    Windows Explorer correctly identifies these as two separate drives. There is, after all, a built in drive as well as the swappable SDcard.
    Sorry I can't be of more help.

  • HT1473 Why do my file get moved

    I have my media files organized in folders. When ever I Add Folders to Library, all my files are moved to one folder. How can I stop this happening?

    I have the "Copy files to iTunes Media folder when adding to Library" unticked but it still does to. Very annoying!!!

  • File loss moving files to a network share

    While moving some files (silly me to use move vice copy and delete later) to a SMB network share about half way through the move OSX lost connection to the share. Error message popped up telling me it couldn't complete the move and the files yet to be moved were deleted! Fortunately they were just some podcasts but I certainly didn't expect that a move operation would delete unmoved files. Is this common behavior under the Mac OSX?
    Lawrence

    Satoru Murata wrote:
    And moving a file from one directory to another on the same drive is "physically" possible?
    Actually, yes. They are fundamentally different. The actual file itself does not change. There is one copy of the file. There is also (at least) one hard link to the file. The hard link is what you actually see in the file system as a "file". In a true move operation, you create two links to the file. There is then one physical file with two pointers to it. Then, after that 2nd link is successfully created, you "unlink" the first one. Correspondingly, to "delete" a file, you just "unlink" the one and only link to it. Time Machine, for example, make extensive use of links to create snapshots of your files. These links are only possible on a single file system.
    Why shouldn't we expect the Finder to be able to do that properly?
    We should. But this is not a bug that should really affect anyone. I'm quite sure that there are more people who, after hearing about this, have tried to use a move across volumes than have ever tried it before. Yes, it is a bug. Yes, you could lose data. But it is a minor operation that few people knew about until recently.
    And there's no guarantee that when you hit the "Send" button in Mail your e-mail will reach its destination. Perhaps you should snail mail it. Strike that, the USPS is even less reliable. Go deliver the mail in person.
    That is a poor analogy. You still have a copy of the sent mail in your system. A better analogy would be to click "send" and then immediately deleting your copy of the sent message. Surely, that would be foolish. And I prefer DHL. I have had much better luck with them.
    No one friggin' needs to use a computer, but a lot of people WANT to. And I'm saying there are people, if you can get it in your stubborn little head, who WANT to use Move instead of Copy, go back to original file/directory, click icon, drag to trash, empty trash, and click OK in confirmation dialog (which, by the way, is a few more than "one additional key" that you allude to).
    My goodness! No need to get so upset
    You can move files to new volumes all you want to. It is always going to be a risky operation, riskier than copying and then deleting. When Apple releases a fix, the risk will decrease, but I would not advise using it, on any platform.
    First of all, who the heck are you telling me I'm the minority so I should just bite the bullet? Since apparently you're such an aficionado of the Terminal, which only 5% of Mac users use on a daily basis, I guess you would be just fine and dandy if there was a glaring bug in Leopard that prevented you from using it "until the software update is available", huh?
    I'm "random guy on the Internet". I thought you knew that. That is an interesting question. I have always liked UNIX and I'm particularly fond of the Mac giving me the best of both worlds. But, I have to admit, I was a very happy Mac user long before MacOS X, so I think I could survive.
    And second of all, you obviously think I'm some Vista troll or something, but I certainly am not, and it's quite insulting. I'm usually the first one to come to Apple's defense when need be. And, as I mentioned in my first post, I agree that this "problem" is totally overblown on various sites. HOWEVER, you are just an idiot fanboy of the worst kind if you maintain that there's really nothing wrong with this bug and suggest that, and I quote:
    Really, the only reason for even attempting this operation is so you can get on the Internet and post a message about how Apple's horrible bug has caused you to lose data.
    No, I didn't think that much about you at all. I was just trying to explain the difference between moving vs. copying and how those operations changed when performing them across two different file systems. I admit I am a bit sensitive about the Mac. I try not to evangelize anymore. I do try to respond to FUD when I see it. There has been a lot of that recently with Leopard.
    I never said this wasn't a bug and that it shouldn't be fixed. I said it was a bug in a non-default behavior that few people even knew about. I also said that even attempting a move across file systems (even without this bug) is not a wise idea. It has a fairly high risk factor, a fairly low convenience factor, and no savings of space or time. It is my opinion that the only reason people care about it is so they have something to bash Apple about. I wasn't including you, personally, in that category. I was just trying to explain my thinking.
    I know I'm fighting a losing battle here. In the "marketplace of opinions" the matter is already decided. Leopard is just as buggy as Vista, if not more so. I've never used Vista, so I can't say for sure. I know the Leopard is perhaps the best, fastest, most bug-free system I have ever used in 25 years. But you wouldn't think that from reading the Internet commentary-du-jour.

  • How can I email a video clip I downloaded into my iPhoto library to my friends? I tried creating an email and attaching the clip but there is no sound and no picture when the 5 minute attachment "plays." How can I file= export it to them from iPhoto?

    How can I email a video clip I downloaded into my iPhoto library to my friends? I tried creating an email and attaching the clip but there is no sound and no picture when the 5 minute attachment "plays." How can I file=>export it to them from iPhoto?

    Have them install Quicktime on their PC's from Apple's website, that's the easiest fix.

  • How do I add a "file folder" to my TC so that I can save files directly to the TC?

    I am trying to figure out how I can add a "File Folder" to my TC so that I can save files directly to it? The only folder it displays is "Data" which is where my bac ups save...

    Double click on the "Data" folder in the Finder under the SHARED heading, and then click the gear icon at the top of the window and select New Folder.
    You can name this folder anything you wish and also create as many folders as you wish.
    If you are also using the Time Capsule drive for Time Machine backups, it is not really recommended that you "mix" regular files with Time Machine backups because there will be a struggle for space on the drive at some point.
    If you have plenty of free space on the Time Capsule drive, you may be OK with keeping a portion dedicated for regular files.

  • I want to transfer all my iPhoto, iTunes, contacts, etc. files from my MacBook, which I am selling to a MacBook Pro. What is the easiest and safest method of achieving this? Can the files backed up on Time Machine be transferred to the Pro?.

    I want to transfer all my iPhoto, iTunes, contacts,documents, etc. files from my MacBook, which I am selling, to a MacBook Pro. What is the easiest and safest method of achieving this? Can the files backed up on Time Machine from the MacBook be transferred to the Pro in some way? I would like to capture the files as they appear on the MacBook, such as "Events" in iPhoto and the various song categories within iTunes without having to rename them all once saved on the Pro, which is the case with photos when I simply save them to thumb drive and import them to the Pro. Sny advice would be appreciated.
    Best regards,
    Rob.

    Michael,
                 Thanks for all your assistance. There is no need for apologies, Migration Assistant did indeed create a second account for the MacBook data. It has just taken me some time to figure out how to access it. I now have all the MB data in one account and the MBP files in another, which suits me fine. In fact, it is an advantage in my case as it keeps the private and business aspects separated.
    I will however try the fatcatsoftware to transfer all the iPhoto files to my iMac, where I keep my main photo library. and it will be of help to keep the events, etc in the transfer. As far as iTunes is concerned, I have HomeSharing on all my computers and this has obviated the need to worry about playlists being transferred successfully. However, HomeSharing did not appear to share the iPhone/iPod apps that were stored on the MB and although these have now come across with the new MacBook account on the MBP, I was wondering whether my iPhone and iPod will be recognised by the MBP and sync with it? Will I need to have the MB account open to achieve this or will the MBP recognise and sync with the iPhone/iPod automatically irrespective of which account is open?
    Thanks for the tip on deauthorising my iTunes account from the MB before sellng. This I will do and I believe the best way to remove all of my data from the hard drive is to reinstall the MacOSX operating system software. Is this the right approach to securely delete everything?
    Thanks again for sharing your expertise and your guidance through this exercise.
    Best regards,
    Rob.

Maybe you are looking for

  • Rescue email doesnt work

    My son forgot his security questions and he can not setup his new Ipad mini.

  • 5.0.2 - Still Can't Import JVC QuickTime Files

    I was absolutely thrilled about the announcement that the 5.0.2 update would allow importing the JVC Pro HD QuickTime MOV files... until I actually tried it. Unfortunately, I'm still getting the import error complaining that the codec can't be found,

  • My Passport External Hard Drive won't show up

    I've been using a My Passport external hard drive for the past two years, and it's always worked perfectly fine. All my files are on it since my Macbook Air can't fit much. But just recently, I plugged it in and the disk runs, and the LED light flash

  • TS3274 how to unlock an iPad that is disabled

    How do I unlock an iPad that is disabled?

  • New PS CS6 freezes on new Win 8 laptop

    I have a new HP envy i7, 16GB, Win 8 laptop and am installing a new Production Premium Suite.  I installed PS, Premiere and Audition.  Premiere and Audition start fine, but PS freezes the moment it is started.  Cannot access any menu items, and have