I m using this code to make a file on my Windows Platform, and it is working fine.
But when i run this programme on linux then it is not creating any file...
I have Replaced the path "c:\\atul.t xt" to "/home/File/atul.txt" and "d:\\outgain.tx t" with "/home/File/outgain.txt"
i have also set the permission for both File and home folder "wrx" it means full permission to the user.
So could any one make it clear why it is not working properly.
<%@ page import="java.io .*" %>
<html>
<body>
<%
FileInputStream in = null;
FileOutputStrea m outfile = null;
try {
in = new FileInputStream ("c:\\atul.txt" );
outfile = new FileOutputStrea m("d:\\outagain .txt");
int c;
while ((c = in.read()) != -1) {
outfile.write(c );
}
}
finally {
if (in != null) {
in.close();
}
if (outfile != null) {
outfile.close() ;
}
}
%>
Success in creating File!
</body>
</html>
But when i run this programme on linux then it is not creating any file...
I have Replaced the path "c:\\atul.t xt" to "/home/File/atul.txt" and "d:\\outgain.tx t" with "/home/File/outgain.txt"
i have also set the permission for both File and home folder "wrx" it means full permission to the user.
So could any one make it clear why it is not working properly.
<%@ page import="java.io .*" %>
<html>
<body>
<%
FileInputStream in = null;
FileOutputStrea m outfile = null;
try {
in = new FileInputStream ("c:\\atul.txt" );
outfile = new FileOutputStrea m("d:\\outagain .txt");
int c;
while ((c = in.read()) != -1) {
outfile.write(c );
}
}
finally {
if (in != null) {
in.close();
}
if (outfile != null) {
outfile.close() ;
}
}
%>
Success in creating File!
</body>
</html>
Comment