Programming

System calls program In JAVA

********************************************************************
System Calls demo program:which is tested under WindowsXP OS
/*Program starts Here*/
/*AIM: TO EXECUTE SYSTEM CALLS ON WINDOWS XP SYSTEM           */

SOURCE CODE:

/*
OUTPUT:
C:\Program Files\Java\jdk1.6.0_02\bin1>javac Syscalldemo.java
C:\Program Files\Java\jdk1.6.0_02\bin1>java Syscalldemo
menu
1.open a file
2.copy a file to directory
3. Get Size of File
4. Rename A File
5. Delete a file
6. exit everything
enter ur choice
1
file opened in web brower see it
menu
1.open a file
2.copy a file to directory
3. Get Size of File
4. Rename A File
5. Delete a file
6. exit everything
enter ur choice
2
copied
menu
1.open a file
2.copy a file to directory
3. Get Size of File
4. Rename A File
5. Delete a file
6. exit everything
enter ur choice
3
Size of file is: 26022
C:\Program Files\Java\jdk1.6.0_02\bin1>4
‘4’ is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files\Java\jdk1.6.0_02\bin1>javac Syscalldemo.java
C:\Program Files\Java\jdk1.6.0_02\bin1>java Syscalldemo
menu
1.open a file
2.copy a file to directory
3. Get Size of File
4. Rename A File
5. Delete a file
6. exit everything
enter ur choice
4
File Renamed
menu
1.open a file
2.copy a file to directory
3. Get Size of File
4. Rename A File
5. Delete a file
6. exit everything
enter ur choice
*/

/*AIM: TO EXECUTE SYATEM CALLS ON WINDOWS XP SYSTEM           */

 SOURCE CODE: 

/*OUTPUT: C:\Program Files\Java\jdk1.6.0_02\bin1>javac Syscalldemo.java C:\Program Files\Java\jdk1.6.0_02\bin1>java Syscalldemomenu1.open a file2.copy a file to directory3. Get Size of File4. Rename A File5. Delete a file6. exit everythingenter ur choice1file opened in web brower see itmenu1.open a file2.copy a file to directory3. Get Size of File4. Rename A File5. Delete a file6. exit everythingenter ur choice2copiedmenu1.open a file2.copy a file to directory3. Get Size of File4. Rename A File5. Delete a file6. exit everythingenter ur choice3Size of file is: 26022 C:\Program Files\Java\jdk1.6.0_02\bin1>4'4' is not recognized as an internal or external command,operable program or batch file. C:\Program Files\Java\jdk1.6.0_02\bin1>javac Syscalldemo.java C:\Program Files\Java\jdk1.6.0_02\bin1>java Syscalldemomenu1.open a file2.copy a file to directory3. Get Size of File4. Rename A File5. Delete a file6. exit everythingenter ur choice4File Renamedmenu1.open a file2.copy a file to directory3. Get Size of File4. Rename A File5. Delete a file6. exit everythingenter ur choice */ /*Program Ends  Here with output*/ Documentation: In this demo program files called like: READMEchange1.html are created first in the drive you want. Limitations: **In case 1 of switch case  block,the open operation is performed only on files located directly in any windows drive,but it doesn't open the files present in directories of any drive. ** Its an Non-Interactive program,that is it doesn't take any input of file names from user ********************************************************************
Advertisements

One thought on “System calls program In JAVA”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s