Can not move rar archives because the packing of them have not yet finished
Hello,
I have a thread wherein I execute the rar.exe cmd line version to compress folders in .rar archives, now after packing them I want to copy them for example to another directory on my hard disk with a java "copyfile" command. The problem is that before all .rar archives are packed or before rar.exe even started to pack the folders at all to .rar archives the "copyfile" command has already been executed by java, but there arent any .rar files because the Runtime.getRuntime().exec method which calls the rar.exe is still busy with packing the .rar archives. So the solution to this problem is to query the Runtime.getRuntime().exec method wether the rar.exe process has already been finished like:
if (Runtime.getRuntime().exec != finished)
dont know what to write here...
else
copy the .rar files
}I also tried this but there is no go :
Process rar = Runtime.getRuntime().exec("./7za.exe a -m9 -r -y -tzip -- H:/bla"+i+".zip H:/*.*");
rar.waitFor();-----------------------------------------------------------------------------
because only the first part .rar archiv gets compressed but stopped when it reached 2KB in size :-) ...
so anyhow the waitFor() method is breaking my whole thread where also the rar.exe is executed!
public void actionPerformed(ActionEvent e)
if(e.getSource().equals(buttonPack))
try
meinThread = new PackThread();
//meinThread.setPriority(Thread.MAX_PRIORITY);
meinThread.start();
catch(Exception a)
a.printStackTrace();
public class PackThread extends Thread
PackThread()
public void run()
filesizeNew = filesizeCombo.getSelectedItem().toString().substring(0,filesizeCombo.getSelectedItem().toString().length() - 3).trim();
String filenameNew = rlsFilenameTF.getText().trim();
String verzeichnisName = rlsSourceDirectoryCB.getSelectedItem().toString();
String targetDir = SettingsPanel.targetDirDefaultTF.getText();
String rarFormat = targetDir+"/"+verzeichnisName+"/"+filenameNew+".rar";
String verzeichnisNameZielAbsolut = SettingsPanel.targetDirDefaultTF.getText().trim();
verzeichnisNameQuelleAbsolut = SettingsPanel.sourceDirDefaultTF.getText();
sourceDirProper = verzeichnisNameQuelleAbsolut.replaceAll("\\\\", "/");
String tempDir = targetDir + "/" + verzeichnisName;
File f = new File(tempDir);
f.mkdirs();
try
Process p = Runtime.getRuntime().exec("./rar.exe a -r -m5 -mm -md4096 -vn -y -v" + filesizeNew +"k "+rarFormat+" "+sourceDirProper+"/"+verzeichnisName+"/*.*" );
p.waitFor(); // This dont work as I said above in the text
// here should be the copyfile or whatever command which needs the .rar archives to do something with them, so they must already be created before this command here is called!
catch(Exception a)
a.printStackTrace();
}
hello,
sorry, but I dont understand what you mean because my native language is not english and I am coding in javag since about 6 months so I am still a newbie :-)
can you explain me a bit more about this problem?
furthermore I have made a workaround now which gets me fever cpu load than than before:
------------------------------------Parts of the code---------------------------------------------------------------
try
Process p = Runtime.getRuntime().exec("./rar.exe a -r -m5 -mm -md4096 -vn -y -v" + filesizeNew +"k "+rarFormat+" "+sourceDirProper+"/"+verzeichnisName+"/*.*" );
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String tmp;
while((tmp = br.readLine()) != null)
}because of the while loop the "copyfile" command coming after this code will be executed to the right time!
But still I would like to have a better solution not such a workaround...but maybe I have discovered the best workaround at all who knows :P
Similar Messages
-
Can't get my Music off of my iPhone 4...
My computer died & had to get a new one, so now I cannot sync my iPhone 4 with the new computer, without losing all of my Music, because the only Music I have is on the iPhone 4 only, not on the computer. No Backup anywhere : (
If I choose to sync it tells me all of the Content that does not match the iTunes library on the computer will be erased, do you want to proceed & I have to say no.
How do I replace the music library on my Computer with the Music on the iPhone?
I got my pictures off because you can access them when you connect the iPhone using Windows 7 but you cannot see any of the music so you cannot access it when using windows so don't know what to do...
Help...The music sync is one way - computer to iphone. The only exception is itunes purchases. File>Transfer Purchases
It has always been very basic to always maintain a backup copy of your computer for just such an occasion. Use your backup copy to move everything to your new computer. -
I can't open one Quick Time movie file. It says: Quick time player can't open (names file) because the movie's file format isn't recognized. Only happens on this one file. All the others of a two hour shoot are fine.
Any ideas what's happened and is there some way to open that file and retrieve what's on it?Thanks this was useful. I have been ripping my audiobooks and I was finding that they would get uploaded to iCloud in the process, which in itself was fine, but then iTunes would not let me change the media type to Audiobook, which is annoying as it effects how iTunes treats the media. Like showing you the skip back 10 seconds button.
The general outline here helped me work around the issue and change the media type before the media was re-uploaded to iCloud.
Sean -
Hi! I have an iPhone 4S with iOS 6.1.3 and I have iTunes 11.1.3.8. on my Windows 8. Now I can't sync my iPhone, because the device is not recognised by iTunes. Somebody have any idea why, or what can I do (except refresh the iPhone software) ?
Hi Drazse,
Thanks for visiting Apple Support Communities.
If your iPhone is not recognized by iTunes for Windows, the troubleshooting steps in this article may help:
iOS: Device not recognized in iTunes for Windows
http://support.apple.com/kb/TS1538
Cheers,
Jeremy -
I can't print a photo because the ICC profile is not installed. What do I do?
I can't print a photo because the ICC profile is not installed. What do I do?
Try from the Editor "Save As"
Then choose jpeg with sRGB profile. -
I'm trying to print a document from safari and the print command is at the bottom of the page and I can't move it up. The print command shortcut doesn't work and I would like to know how I can print this document.
Why do we have to install 2 add ins for something that should be built in? Please add this to the next version or an update to this one even. We should see the full path of a bookmark when we search for it. Show Parent Folder alone isn't enough if you have sub folders, so I installed Go Parent Folder as well in case of sub folders.
-
Can i move my music to the cloud then delete from my pc?
can i move my music to the cloud then delete from my pc? using icloud.
Note that Cloud/Match is not the same as a backup or archive of your music. For example, if you have a top quality AIFF file of music and use Match, it will store it as a lesser (but still okay) quality AAC copy. There's a number of similar reasons for not seeing this as the equivalent of a proper archiving drive but basically Match is designed as a convenience for those who want their music anywhere but are willing to work with the multiple, if minor, discrepancies between it and carrying around a hard drive.
-
I had all my software, including my ‘Adobe Creative Suite 4 Design Premium’ removed from my MacPro (OSX 10.10.2) by a Computer technician after I had inadvertently installed some malware.
Now I can’t reinstall my CS4 because the installer software wants me to identify the product from which I am upgrading, but mine isn’t on the list. The old product from which I am upgrading is called ‘Adobe Design Collection’. Furthermore, it has 4 serial numbers (one each for Photoshop, InDesign, Acrobat and Illustrator), not just one, as the installer requires.
I know this can be done, as I have had it working for a long time. Am I doing something wrong now?Contact support be web chat and have them generate a working temporary serial/ challenge code for the install.
Mylenium -
I have an iMac 10.8.2. When trying to download a photo attachment from an email I received the following : "You can't open application IPhoto because the classic environment is no longer supported." This occurred on 10/25/12 at about 11PM CST. The iPhoto icon in both the dock and the application folder is grayed out with the no or do not enter symbol. How can I resolve this so I can access my photos?
I have two iPhoto icons in applications. One is grayed out and has the no symbol, the date of last modification is Oct 25, 2012 11:07pm. The size is 110 KB and kind shows Applic…lassie). When I click on with CMD i it shows:
kind: Application (Classic)
size: 109,677 bytes (111 KB on disk)
Where: / Applications
Created: Thursday, October 25, 2012 11:07 PM
Modified: Thursday, October 25, 2012 11:07 PM
Version: --
More info: --
Name and extension: iPhoto.app
Hide extension is grayed out and checked
Preview shows a photo I had attempted to save to iPhoto
The second iPhoto icon is also grayed out, but the symbol is an envelope, the date of last modification is Oct 12, 2012 12:09PM. The size is 548 KB and kind is shown as an email message. When I clicked on it with CMD i it shows:
Kind: Email Message
Size: 547,665 bytes (549 KB on disk)
Where: /Applications
Created: Friday, October 12, 2012 12:09 PM
Modified: Friday, October 12, 2012 12:09 PM
Version: not listed
Name & Extension: iPhoto.eml
Hide Extension: checked
Open with: Mail
Preview shows a photo I had attempted to save to iPhoto -
Am I able to get a refund with the movie I rented because the movie download was complete but only played 1/4 of the movie and wouldn't play the rest?
iTunes Support (these are user-to-user forums) should either grant you a re-download or credit you if it didn't play in its entirety - try the 'report a problem' page to contact them : http://reportaproblem.apple.com
If the 'report a problem' link doesn't work then you can try contacting iTunes Support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption -
Can we move char type data to packed decimal
Hi
can we move char type data to packed decimal??
Thanks
DeviHi..
that depends on the data in the character variable..
if that character variable contains onli numbers then it is possible.
<b>data c type c value '1'.
data p type p.
p = c.
write p.</b>
here the output is 1.
If it contains even a single Alphabet , then it goes for a dump.
<b>data c type c value 'A'.
data p type p.
p = c.
write p.</b>
here u will get a short dump.
hope u understood.
regards,
sai ramesh -
I recently changed my email address at the online iTunes website. Now I can't update my apps because the log-in shows the old email address, but won't accept the old password. How do I fix this?
To Contact iTunes Customer Service and request assistance
Use this Link > Apple Support iTunes Store Contact
Note:
Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
Apple ID FAQs > http://support.apple.com/kb/HT5622 -
I can't make purchases anymore in the App "Clash of Clans" and yet I can purchase music and movies from the iTunes store. Can someone help?
What happens when you try to buy them, does the 'buy' button not work, do you get any error messages ... ?
If you are getting a message to contact iTunes Support then you can do so via this link and ask them for help (we are fellow users on these forums, we won't know why the message is appearing) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption
If it's a different problem ... ? -
In Mail, my message preview used to be shown to the right side of the messages. Now it is showing below the messages. How can I move it back to the right?
Select the Viewing tab in the Mail preferences dialog and uncheck the box marked Use classic layout.
-
[Windows user] I have an ipod touch 5th generation 64gb and I can't backup my ipod. I have restored it many times, even in recovery mode, but it still comes up with "iTunes can't backup this ipod because the session has failed," yet it was still plugged in. Also error 54 pops up too. Does anybody know how to fix this?
If a PC try:
Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
or
Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
Maybe you are looking for
-
Can I receipt a material which has a block on it like 01 or 02?
I have an internal customer who wants to put a block on the material which is on order. The PO has been released and they want to put a block on it. I am wondering if I put a block 01 or 02 on it would they be able to receipt the item when it actual
-
Autofill won't work but it is checked off.
Autofill won't work but it is checked off. I went through the normal steps to try to fix it. it used to work and suddenly stopped.
-
Remote execution of DTS packages from Java Stored Procedures
I'm an Oracle 10G DBA and Linux/Unix Sysadmin looking for a Java guru to help me find a reusable template or locate a solid programming methodology (examples) that will enable me to connect via JDSI to SQL Server 2000/2005 and remotely execute DTS pa
-
Invalid document number [RCT2.DocEntry][line: 1]
I'm getting this error when creating Invoice then Incoming payment. Though, in the other transaction it successfully saved. Here's my code in incoming payment .Invoices.DocEntry = oDocNum '<--- it was retrieved by oCompany
-
Why is the quality of movies and pictures exported to the external hard drive lowered?
Why is the quality of movies and pictures exported to the external hard drive lowered?