linux 2 « Development « Java I/O Q&A





1. Java File IO getCanonicalFile() handling Linux Symbolic links    forums.oracle.com

Does anyone have any experience using the File.getCanonicalFile() method. I would prefer to use the getCanonicalFile() to obtain the real file pointed to by a symbolic link, rather than the Linux "ls" command. I currently check for any changes by executing a "ls" every second,when I test the getCanonicalFile() method, I see he doesn't seem to keep up with the real ...

2. File.length() issue in Linux    forums.oracle.com

I want to check whether the file(/users/deepak/file1.zip) is still downloading in linux. I used below logic to check whether the file is still downloading or completed downloading. File f1= new File("/users/deepak/file1.zip"); int beforeSleep= f1.length(); Thread.sleep(2000); int afterSleep= f1.length(); if(beforeSleep == afterSleep) { System.out.println("Download completed"); } else { System.out.println("Still downloading"); } In windows the above code executes as expected. But in Linux, ...

3. problem with file path in linux    forums.oracle.com

hi, i have problem with file path accessing in linux. my java class is accessing a abc.cvs file and and getting all data. it is working fine in windows xp. but i run this same file in linux it does not access the abc.cvs file and does not get any data. my project structure Search abc.cvs search.SearchMain i am sccessing this ...

4. Linux file path issues    forums.oracle.com

All, when I use a linux path to download a file I get directory not found. In the error I see '\' is added to the path. So I try to use /var/www/data/ this comes out as \/var/www/data/\. I have to use Strings for the file paths. I cannot use getResource..... Why I am getting this problem? Is it a linux ...

5. Executing a .sh file from a Linux launcher    forums.oracle.com

6. Java read/write big file issue in Linux    forums.oracle.com

////[?]if delete the new file, resource will be released. //File newfile = new File(newPath); //newfile.delete(); //System.gc(); //System.runFinalization(); System.out.println("End"); /** run in Linux, cmd: * /opt/IBM/WebSphere/AppServer/java/bin/java /tmp/Test.class * * After set JVM heap size[16M~32M] of websphere application and run in websphere, * it seems that no such problem. But we have to set the heap size with value[0~512M] for other programe. * ...

7. nio on linux    forums.oracle.com

8. problems reading files on linux    forums.oracle.com

Hi, Im trying to read a file on linux but it seems that its text editor send some information, that can't be seen on the text file when opened, but that java reads and tries to throw into this double array im using.. Im telling java to convert all it reads to int, as all the information put in there by ...

9. Linux Compability files    forums.oracle.com





10. Serialization of Linux files......    forums.oracle.com

I don't know what is the data in those serialized files and neither do i have the serialized class files in my environment. I cant even get the serialized class files. But the serialized file contains a few mail addresses.Does this cause the error? Is there any other way to work with..... Gita.

11. Unicode filename problems in linux    forums.oracle.com

But the characters are actually chinese. And since it's on Ubuntu, it would be in UTF-8 encoding wouldn't it? The characters display fine in ubuntu but when I try to read them in using FileInputStream, it fails for some filenames with strange characters. I just don't understand why some characters make it fail and others are fine. It seems that it ...

12. Calling *.sh files in Solaris and Linux from any JAVA application    forums.oracle.com

Well, call the unix script directly (you don't need this cmd bullsh1t in unix). For number 2, your looking at a script somewhere in the /etc/rc* directories. Edit: on second thought forget number two. For that (since you want it to start as a daemon from your Java process) you need to call the script using nohup and/or &

13. File getName on Linux platform    forums.oracle.com

Not sure if you got an answer but I just ran into this issue too. The issue is that the \ character is valid in a file name on Linux. What I ended up doing is translating the \ character to / in the path. To get the name then you have to create a File object with the translated name ...

14. File upload in Linux Platform    forums.oracle.com

Hi, I have a web application with file upload , which is working fine in my local machine(Windows platform). But when I deploy the .war file in Linux based system, the file upload option is not working. I have used the following in my jsp page. <%@ page contentType="text/html;charset=windows-1252"%> <%@ page import="org.apache.commons.fileupload.DiskFileUpload"%> <%@ page import="org.apache.commons.fileupload.FileItem"%>

15. What Runtime exec with input file on linux not Run ??    forums.oracle.com

The JMSAdmin is a IBM Java Console Utility, when execute JMSAdmin the same display a line command and when i use JMSAdmin < jcajms.scp in a linux terminal this run geting the file commands and exit fine, but when i call the same by a java program the JMSAdmin cannot accept the file parameter and wait it is in the command ...

16. Read linux lastlog file and convert to a String    forums.oracle.com

Hi I am trying to read the data from the lastlog file in Linux. I think this is a binary file encoded in ASCII. How would I go about reading this file and converting the binary data into a String and then displaying the data? Each bit of data is separated by a new line to distinguish between the different values. ...





17. File problem in linux OS.    forums.oracle.com

But my problem in linux. when i click survey menu, it will defaultly stored in root folder and log folder. Actually i am not creating LOG folder in root folder. I am changing file writer as , to store that JAR folder and want to store that log file in home directory.

18. Accessing methods in linux .so file    forums.oracle.com