Windows 2 « Windows « Java I/O Q&A





1. COM ports in Windows    coderanch.com

I've been curious about that for a while, so I did some digging on the java.sun.com forums and found this post: Re: javax.comm version 3.0 for Windows? Author: MikeR@Sun Posts: 21 Registered: 7/27/03 Dec 5, 2005 8:26 AM (reply 18 of 20) FYI, I just got in touch with the developer for javax.comm. The problems that Faz is seeing are caused ...

2. What happened to the Windows Comm API?    coderanch.com

Thanks Paul for the quick response. To summarize, the Java Comm API for windows has been discontinued. To quote from the original post in the Sun forum: javax.comm 3.0 has replace javax.comm 2.0: Sun is no longer offering the 2.0 release of javax.comm, since 3.0 Update1 contains important bug fixes allowing to better support it.. javax.comm 3.x offers new conveniences for ...

3. Windows, I/O is not interruptable.    coderanch.com

Still... I am not sure how this is related to threads or synchronization. Unless this is some continuation of another topic here. If this is the case, please continue the discussion in that topic. In the meantime, I am going to just close this topic, as I am not sure where to move this topic. Henry

4. Can java access Windows "file-properties-summary" ?    coderanch.com

Hi, Windows (at least, Win XP) offers an option to keep some 'summary' for each file. This summary is accessed through 'file properties' (right-clicking the file, and selecting 'properties'). This yields a popup, with a 'Summary' tab. My question: can JAVA access this 'file summary' text (read and write summaries, preferrably without using JNI ? (Needless to say, I know this ...

5. Finding PID from file in Windows    coderanch.com

You don't make it clear whether you are trying to do this from a Java program or from the command line. If from a Java program, there are no pure Java solutions to this. You would need to use either native Windows code (JNI) or to run an external native program via Runtime.exec(). If you just want to do it from ...

6. Java6 gives wrong file timestamp during daylight savings on windows    coderanch.com

1) If I create a file at 10am in windows the timestamp is 10:00, regardless of whether it's daylight savings or not. 2) In Java 6 I do System.out.println("Time: "+ new Date(file.getLastModified())); the time will show as 9:00 during daylight savings time. In Java 5 the time will be 10:00 as expected. 3) In Java 6 if I do a setLastModified ...

7. USB API for Windows    coderanch.com

Hello We have an application (GUI) that uses a printer on COM port. Now they bought a new printer (same model) and it will be connected to USB, I looked on internet and only found an API to be used on Linux but we use windows on clients. There are some API to be solve our problem ? thanks Leandro R. ...

8. USB+Windows(needed libruary)    coderanch.com





10. Accessing file on remote windows share    coderanch.com

You should be able to access that file from your servlet app with the UNC name (the syntax you're using). From there, you could stream the file to the browser from a servlet. I have a simple webapp example that streams image files to the browser. That might get you started. http://simple.souther.us/SimpleStream.war. In that app, I'm using Context.getRequestAsStream to read the ...

11. How to set/modify Windows File Properties via Java?    coderanch.com

My program creates Microsoft Excel Regression Functions, and saves them as *.bas files (Visual Basic for Applications). When I create these text files in Java, I want to assign file properties to them. These are the properties that are called up in Windows by right clicking on the file and selecting PROPERTIES->SUMMARY->ADVANCED. Windows allows a Title, Subject, Keywords, and other Meta-information ...

12. Windows XP shits, sorry cheats, with *.java files    coderanch.com

While searching a directory for string class (or any existent string inside *.java files),option all files and folders, in Windows XP, I had repeatedly for *.java files: Search is complete. There is no result to display. Well, after renaming *.java to *.txt, the search started to determine files. And vice versa... Can somebody confirm/repeat it in Windows XP? i.e. that any ...

13. Writing files on Windows XP    coderanch.com

I am having some very difficult times with what I would imagine would be a very easy task. I am trying to write a simple txt file to the "My Documents" directory on Windows XP. The odd bit is that the directory and every directory under it is marked as read-only, and the File.canWrite method is returning false as would be ...

14. System.out.println on Windows    coderanch.com

Sorry if this is incredibly basic. I've looked and I can't find an answer here but I can't be the only one this is happening to: I can't get System.out.println to print anything to the Windows command.com console. If I run under Netbeans, the output shows just fine in the output box. But I'm trying to be a good girl and ...

15. Autenticate from java into Windows Active Directory    coderanch.com

Hello all, I have a code in Java to autenticate an user against the Windows Active Directory. But I also want to develop a function to change the password of a user, and other to check if a user exists in the Active Directory (without using the password, only the user name). Can anyone help me? The code I use to ...

16. pipe data through stdout in windows.    coderanch.com

I have been googleing all day and this is driving me mad!!! program2 processes data from program1 in the usual *nix way. program1 < input.bin | program2 > output.bin no problem in Unix. in win32, stdin / stdout are not binary, but foratted text, ( replaces \n with \r\n etc etc ANNOYING ) in c, i would normally use freopen in ...





17. How do i use windows to find a string pattern in one of my .java files?    coderanch.com

The UNIX tool that does this is called ... grep, which windows doesn't seem to have. However, grep seems to be so popular that if you google "grep windows", you get a ton of tools that claim to do what grep does, except on windows. Maybe one of those grep-like tools might work. Henry

18. using API functions in DLL files in windows    coderanch.com

hi, everyone. I need help please in solving this problem. I need to use API functions in DLL files to complete a class test. I heard JNI can help but as I'm a beginner I have not used JNI yet. So in two parts I need your help please, first using API functions, second using JNI. thanks, ali.

19. Disable windows key    coderanch.com

20. Program Cannot Write To Hard Drive: Windows 7    coderanch.com

I am using Windows 7 and Java 6 update 20. My program has a user interface through which data is passed and must be written, but Windows will not allow my prgram to write to the hard drive. How do I get my program to request permission to write to the hard drive?

22. Reading Secure Windows share using Java    coderanch.com

23. Post Java execution, opening completed file on Windows    coderanch.com

No I have this little Applet / Application for my company, it simply takes in an excel file, highlights specific cells. Then saves the new file. I want my program to open that file on the user's computer once it is saved. EDIT: So the user doesn't have to go in and open the file him/herself.

24. Opening files with .jnlp extension in IE 9 (Windows 7)    coderanch.com

Internet Explorer 9 on Windows7 is not able to directly open and run a .jnlp file. It asks for the prompt "do you want to open or save xxx.jnlp from " every time and does not give an option to either Run the file or "remember to do this for this file extension always". Firefox seems to work. First time ...

25. windows API with java    coderanch.com

26. RXTX in Windows 7 64 bits    coderanch.com

Hi guys, I've developed a software that exchanges messages with a hardware using JavaComm. As JavaComm doesnt have x64 support, so I had to change to RXTX. This activity was fine and easy. Now I have my software working in Windows XP 32 bits and Windows 7 64 bits... But, In Windows 7 64 bits, RXTX doesnt work very well. In ...

27. Windows file format header    coderanch.com

28. get windows file attribute?    forums.oracle.com

Is it possible to read the Windows file attribute "Owner" (or others, for that matter)? I'm writing a program that searches through a network folder and finds files that fit a certain criteria. When it finds it, it writes the name to an output file. I'd like to have the "Owner" in the output file, so I can easily see who ...

29. how to store a file in windows registry    forums.oracle.com

30. Deleting files created in a duration from Windows 2000 using Java    forums.oracle.com

Dear All, How to delete files from Windows 2000 which are created between two dates? What is the relevant Java API, related functions? We have an FTP servers on which users put files regularly and we have to keep files which are 45 days old only. Currently we are using AWK for the same. Please guide me to write a Java ...

31. Determining if a file is read-only on Windows    forums.oracle.com

32. running compiled files on Windows    forums.oracle.com

Hi, I have Java 1.6.0_03 installed on Windows XP. I have set up a path to \Program Files\Java\1.6.0_03\bin. Javac therefore runs normally from the command prompt. However and it is a big however, when Javac processes the desktop saved file, there is no sign of the compiled class file. If I type Java name, I just get the error: Exception in ...

33. Can java Access windows dll files ???    forums.oracle.com

I have to write a program in which i aim to use windows dll files and the funtions that are declared in that file. for example i have to get the system information of my computer using the windows dll file. and i have to open/close CD ROM using windows dll files. can Java has ability to access and use the ...

34. Open with MyJavaTextViewer when double-click on the file icon. (In Windows    forums.oracle.com

I create a program called MyJavaTextViewer. I create text file with .MyJavaTextViewer extension and I want to open that file in MyJavaTextViewer when user dbclick on that file (Like .txt file opens in Notepad when user dbclick on that file icon). I want get the content of that file to String. How can I do this several actions????

35. Java code to list files in Windows O/S by FIFO sequence    forums.oracle.com

Hi, I am new to java and working on a project which needs to list files from Windows O/S by FIFO sequence. Here is the scenario, One of the application logs/stores files in Windows System. After that files has to be moved to another files system on AS/400 by FIFO sequence. I need to write java program to list files in ...

36. How to run .java file in windows ?    forums.oracle.com

... First, U must make sure that there is JDK on your computer Then, set the envionment variables which the os can find your compiler and interpreter: javac java after those, you must complie your .java file to .class file, then you can excute it by java, for example " java helloworld"

37. How to create a CIFS (Windows File Sharing) share    forums.oracle.com

I recently started a new programming job that deal primarily with Java. I have been a C programmer most of my life, so I am making a transition during this process. I am familiar with Java, if only in that I have dabbled with it previously. The project I am going to be taking over is written exclusively in Java (targeted ...

38. Windows can't open this file    forums.oracle.com

Thanks for your reply! I started by using Notepad to create a file named Hello.java When trying to open that file, perhaps to edit it, the fault code displays Windows unable to open this file. Even though I've already downloaded and installed Java as detailed above, I can't open the file. I've also tried to open other java samples with extention ...

39. Error when run java file on windows 7 64bit    forums.oracle.com

do you have a link beacuse i've tryied downloading and installing all kinds and this is the only one I could find thats work with my machine jre-6u20-windows-x64. I think I need a 32bit version that works on my 64 bit machine but I have tried uninstalling jre-6u20-windows-x64 update then using the version checker and is says that java 6 is ...

40. execute windows command line to a file    forums.oracle.com

41. modfiy file keywords in windows?    forums.oracle.com

Is it possible to modify the keywords & other attributes of the file? (in other words, the attributes that are modified in Windows by right-clicking on the file, hitting Properties, and going to the Summary tab) I'd like to prompt my users to specify a string of keywords & a project name, and then have the script plug those in to ...

43. Open file doesn't work on Windows 7    forums.oracle.com

Hello , I have this portion of code that should open a file and let windows decide what program to use for that : Code 1 : Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+"c:/x.xls"); Code 2 : File f = new File("c:/x.xls"); Desktop.getDesktop().open(f); None of this options opens the file , no error is caught , no nothing. The result of RUN si "Buid succesfull". ...

44. Windows > Associating File Types With a Java App    forums.oracle.com

I'm interested in knowing how the whole process of setting up file associations in windows through Java works. The goal here would be to have saved user data files from my application have the ability to be double clicked, launching the Java application and restoring the data stored in the data file to the user interface (similar to how clicking a ...

45. Read/Write windows file metadata    forums.oracle.com

46. windows 7 and file input    forums.oracle.com

Given the evidence that I just installed Windows 7 (obviously). I'm also not a beginner so I should know what I'm doing, but I guess I don't haha. I did some file I/O on Vista recently and it worked fine. I don't believe I used a Scanner, but it shouldn't matter, because it's not finding the file. exists is returning false. ...

47. Handling file downloads in windows    forums.oracle.com

I'm doing some web automation using selenium. Basically it simulates navigating through a browser. Selenium can't handle windows events though. For example, if I click on a file to download in IE and a box pops up asking if I want to download the file, Selenium can't handle that. I need to figure out a way in java to see that ...

48. java.io.Console console=System.console() returns null in windows    forums.oracle.com

Hi, I am trying to capture userid/password on console and using java 6 console api for that. But it returns null, when I call System.console(). Can anyone please let me know the possible reason Or how can I use console API to capture password on console. The code, what I am using is public static String getUserInfoFromCommandLine(String caption, boolean isPassword){ String ...

49. Invoking windows file search function in Java    forums.oracle.com

hi, i am using JXTA to search a file on p2p network (taking input from user), so for that purpose i will need to invoke other machine's search functionality giving the file name (entered by user) as a parameter to that command, which i can send as JXTA message over network. -Prasad

51. Writing to files on windows    forums.oracle.com

Hi I have a jvm that will write some text to a file on a windows file system. There is some another process that will read it. This other process is beyond my control i.e. it wont be written by me and won't be java. How do i ensure that my jvm that writes to this file only when no other ...

52. File owner - Windows XP    forums.oracle.com

Hi all, I need to access to particular file property/field called "owner". Value of this field can be seen for example in Windows Explorer (Column "Owner"). I would like to be able to read this value for given file (and if possible also edit this value) from my java app. Does anyone have a clue how to manage this? It's not ...

53. Trasfering files from liux to windows    forums.oracle.com

54. Sorting string like windows file name sorting    forums.oracle.com

Is there a way to achieve the string sort similar to windows rather than aplhabetically like the default sort of Arrays/Collection. I have done some searching but only found problem regarding to different language character sorting which can be achieved using Collator but this was not my case. Has anybody encounter this issue ? Any help is greatly appreciated regards Hendra ...

55. Creat windows short filename    forums.oracle.com

Hi, I am running a batch file from java app using the Runtime.getRuntime(); method. If there is white space in the file path, it throws an error thinking that its the end of the arguement. If I put the path in quotes, it still doesnt work. The only way is to change the path to a windows "short path" e.g. C:/Documents ...

56. Error while installing jdk1.5.07 on Windows 2000.(data1.cab file missing or    forums.oracle.com

I have tried downloading it again and also used the installer which was successfully able to install on Windows XP. Also, a few days back I was able to install jdk1.5.0.07 but then my system was attacked by some trojan and I had to format it. Since then I am unable to install it using the same exe.

57. Read files under C:\WINDOWS\system32    forums.oracle.com

58. Windows File Time stamp    forums.oracle.com

Hi! thanks for the response I have written the code to retrieve the creation, access and modified times using Run exec (). A user enters file or directory name and idealy it should output those times. When i run the program I get IOException error=2..... a lot of articles online suggest the error means that the files is not found but ...

59. Windows holding file lock    forums.oracle.com

I am working on a bug just now where the following snippet of code is causing the file to be locked. protected void checkHTTPResponse(URLConnection connection) throws IOException { // get the first header line String header = connection.getHeaderField(0); // if the header is null, we can't do much about anything if(header == null) throw new IOException("No information was returned from the ...

60. how to store a file in windows registry    forums.oracle.com

61. Checking to see whether a user exists in a Windows Active Directory    forums.oracle.com

I have a little java applet that has to run through a large list of users, and for one of its tasks, it has to check to see whether that user exists. Mostly this is the same as running with local users, with the one exception that I can't just check to see if a home directory exists. Right now I ...

62. Getting windows file attributes using Java APIs    forums.oracle.com

Hi Experts, I have a requirement to read all file/folder attributes from Windows such as Author, Created date, Modified Date, permissions on the file/folder etc. through a JAVA application, Is there an API in Java that lets me communicate with the Windows utility ? Thanks in advance for any help !! - Lasya

64. Can java Access windows dll files ???    forums.oracle.com

I have to write a program in which i aim to use windows dll files and the funtions that are declared in that file. for example i have to get the system information of my computer using the windows dll file. and i have to open/close CD ROM using windows dll files. can Java has ability to access and use the ...

67. Is it possible to write file from AIX machine to windows machine?    forums.oracle.com

tx for responding.. Actually my application is running on AIX machine. The application is writing response file on AIX machine properly. But my requirement is to write that file on windows machine. B'coz the requesting application is reading that file frm window machine. I am not getting any way to write that file to windows machine directly. Is there any direct/indirect ...

68. Linking Error - Can NOT link the library files on Windows    forums.oracle.com

I am not able to link the library files on MS Dos I have all the source files in one folder & lib in another folder which is within the source folder. Compilation: works fine javac -classpath lib\poi1.jar;lib\poi2.jar;lib\poi3.jar *.java Run: NOT WORKING (GUI shows up, but when I call the method that requires the Library files, not working at all) java ...

69. Wrong File(parent, child) behaviour on Windows when child starts with one s    forums.oracle.com

I've sent following problem report: A DESCRIPTION OF THE PROBLEM : On Windows when relative path starts from one slash it should be resolved from current disk (not current directory). This behaviour should be preserved for Files constructed with constructor File(parent, child). So results of run "System.out.println(new File(dir, relPath).getAbsolutePath())" and "System.out.println(new File(relPath).getAbsolutePath())" should be identical when running program from directory "dir". ...

70. Windows UNC to File?    forums.oracle.com

I'm trying to get the working directory as a java.io.File. I'm currently using the following: workDir = new File(LGM.class.getProtectionDomain().getCodeSource().getLocation().toURI()); and it works great in every normal scenario. However, it becomes a problem if the jar/program resides on the network and I try to access it from Windows. Here's the resulting URI file://RAPHAEL/shared/enigma-dev/lgm16b4.jar Now, the // gets interpreted as an authority component, ...

71. Opening a file in Windows - Backslash    forums.oracle.com

In the second code, don't bother to try replacing backslashes with slashes. You aren't doing it right, but that doesn't matter because you don't have to do it at all. It's unfortunate that you don't show the code which gets the file from the JFileChooser, because there's a good chance you chose the wrong method. Like choosing getName instead of getFile, ...