الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

How To Copy File From Directory To Another

بدأه medhat_fci في 19 أبريل 2008 · 1 رد · 690 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

hi all,

i want to copy MS-Access file from directory to another, i knew that we must use Runtime class and passing cmd commands , i tried but there is no any action, please if any one know the correct way for this, tell me.

Thanks in advance

#2
import java.io.*;
class A{
	public static void main(String args[]) throws IOException{
	   // in Mac
		Runtime.getRuntime().exec("cp /Users/eisa/documents/myFile.odt /Users/eisa/Desktop/."); 
	   // in windows similar to this 
		Runtime.getRuntime().exec("copy c:/myFile.doc c:/windows/myFile.doc");

	}
}

هناك طرق اخرى غير هذه الطريقه مثل قرائة الملف الاول ومن ثم كتابة نفس المعلومات في الملف الثاني

مواضيع مشابهة