Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
fileoutputstream
- Page 1
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
… label syntax is incorrect) at java.io.
FileOutputStream
.open(Native Method) at java.io.
FileOutputStream
.<init>(Unknown Source) at java… find the path specified) at java.io.
FileOutputStream
.open(Native Method) at java.io.
FileOutputStream
.<init>(Unknown Source) at java…
FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
… works like a charm), do some wrapping: [CODE] try {
FileOutputStream
fos = new
FileOutputStream
("http://mitch9654.zymichost.com/songs.DAT"); OutputStreamWriter…) { e.printStackTrace(); } [/CODE] when I do the "fos = new
FileOutputStream
("http://mitch9654.zymichost.com/songs.DAT");" thing…
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by NormR1
[QUOTE]
FileOutputStream
.<init>([/QUOTE] That shows the constructor for the
FileOutputStream
class. Can you show me the Constructor for the
FileOutputStream
that takes a URL as an argument? [QUOTE]and the code that is generating them.[/QUOTE] Where's the source code for line 253?
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
…that you don't put in: [CODE]fout = new
FileOutputStream
("file:myfile.txt");[/CODE] instead, you put …in: [CODE]fout = new
FileOutputStream
("myfile.txt");[/CODE] though maybe I can't… use
FileOutputStream
because I am using an applet... Any suggestions for …
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by NormR1
…? Please show the full text of any error messages. [QUOTE]
FileOutputStream
("http://mitch9654.zymichost.com/songs.DAT");" [/QUOTE… http: protocol be a local file? The API doc for
FileOutputStream
(String) says: [QUOTE] Creates an output file stream to write…
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
… a way to create a File or OutputStream (any type;
FileOutputStream
, DataOutputStream, anything that implements/extends OutputStream) object without having my…
FileOutputStream and FileWriter
Programming
Software Development
15 Years Ago
by rimorin
Dear JavaFans, I notice that if you use
FileOutputStream
and FileWriter to write a string into a textfile (.txt) , the Java i/o implementation doesn't seems to recognize the syntax \n which is the newline function. Anyone facing the same problem? The output text file will simple display all strings in one straight flow without a leaving lines.
FILEOUTPUTSTREAM and FILEINPUTSTREAM
Programming
Software Development
15 Years Ago
by charpays
How can I do this?
FILEOUTPUTSTREAM
and FILEINPUTSTREAM provide code that will write bytes to file and read them back
Re: FILEOUTPUTSTREAM and FILEINPUTSTREAM
Programming
Software Development
15 Years Ago
by Ezzaral
[QUOTE=charpays;1166738]How can I do this?
FILEOUTPUTSTREAM
and FILEINPUTSTREAM provide code that will write bytes to file and read them back[/QUOTE] With a text editor, of course.
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
By going kablooie, it inverts all of the slashes ! Well, if the applet reads files from the website, (the view songs button) Why can't it write? If it can read the files that are on the website (local because the applet's html file is in the same directory), why can't I write? All I want is a writer to a file thats URL contains '/' things …
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by NormR1
When you "write" data to a server, there must be code on the server to read and process that data. What do you expect to happen if you are able to write something to a server? All websites have servers. [QUOTE]applet reads files from the website[/QUOTE] Do you have some code that reads files from a website? If you look at that you might…
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
[QUOTE=NormR1;1247318]When you "write" data to a server, there must be code on the server to read and process that data. What do you expect to happen if you are able to write something to a server? All websites have servers. Do you have some code that reads files from a website? If you look at that you might get some ideas how to …
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by NormR1
[QUOTE] it is not so much a server but a website[/QUOTE] A website can NOT function without code to receive messages and send responses. The name for that code is a server. To read a file from a server you send an HTTP GET message to the server requesting that it return a file to you. The HTTP protocol defines the messages that are sent and what …
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
[QUOTE=NormR1;1247356]A website can NOT function without code to receive messages and send responses. The name for that code is a server. To read a file from a server you send an HTTP GET message to the server requesting that it return a file to you. The HTTP protocol defines the messages that are sent and what the responses should be.[/QUOTE]…
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
So how can I do my BuffedWriter and all the wrapping without FileOututSream changing my slashes?
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by NormR1
Write the slashes correctly for the classes you are giving them to and they shouldn't be changed.
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
but look at the java console when checking out my website. I made it show the string that was used when I ran it from an html file on my computer (that doesn't work also, but it runs like a charm in appletviewer. Here is the html file on my computer java console message: (In java console) [CODE]the url is: /E:/Documents%20and%20Settings/Mitch/My…
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by NormR1
A URL starts with a protocol like HTTP or FILE Your URL isn't valid. File paths use separators between path segements. On Windows the separator is \ What you show is a file path. You are giving a "path" to class that expects a file path and formats what you've given it according to the rules on that OS. For Windows it uses \
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
I converted the url to string and did the [CODE]string = string.replace("file:", " "); string = string.trim();[/CODE] commands. Also, it NEEDS to have no "file:" in the url. IF it has a "file:", nothing works. Even appletviewer errors out. If I do my commands above, appletviewer works, but running on an …
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by NormR1
Please show the error messages and the code that is generating them. Please explain your understanding of the syntax of a URL. I think the first part of it is the protocol: http:, ftp:, file: etc. The API doc gives: <scheme>://<authority><path>?<query>#<fragment>
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
YES!!!!! It is all of the %20s!!! I did some: [CODE]string.replace("%20", " ");[/CODE] and it works like a charm!!!! Thanks, Mitch
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by NormR1
[QUOTE]appletviewer is happier without "file:" attached to it[/QUOTE] You mean a specific class constructor, not the program running the applet. [QUOTE]ny suggestions for something to access a file for writing?[/QUOTE] Where is the applet supposed to write this file? If on the local system, it will need permission. If on the server, …
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by NormR1
[QUOTE]without having my '/' slashes changes to '\' slashes[/QUOTE] If you are passing a String as a filepath on a Windows system, the path separators should be \. The Software will change them as needed. If you pass the String as a URL they shouldn't be changed as \ has no meaning in a URL.
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
[QUOTE=NormR1;1248857]If you are passing a String as a filepath on a Windows system, the path separators should be \. The Software will change them as needed. If you pass the String as a URL they shouldn't be changed as \ has no meaning in a URL.[/QUOTE] What constructer for an OutputStream or its children classes should I use that uses a …
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by NormR1
Do you have the API doc for Java? That's where to look to see what constructors use URLs. I don't know the API well enough to answer your question. I'd have to take a look thru the various classes to find the answer. If you do the lookup yourself, you'll learn how to use the API doc and probably find a lot of things that you didn't know that will …
Re: FileOutputStream slashes problem
Programming
Software Development
15 Years Ago
by mitch9654
[QUOTE=NormR1;1249058]Do you have the API doc for Java? That's where to look to see what constructors use URLs. I don't know the API well enough to answer your question. I'd have to take a look thru the various classes to find the answer. If you do the lookup yourself, you'll learn how to use the API doc and probably find a lot of things that you…
Re: FileOutputStream and FileWriter
Programming
Software Development
15 Years Ago
by masijade
How are you determining that it "doesn't recognise \n"? If you are "checking" the file with Notepad, it is that notepad "doesn't recognise \n", try checking with wordpad (assuming you're on windows, and on MAC the "newline" character is "\r" on Windows it is "\r\n"). You shouldn't be …
Re: FileOutputStream and FileWriter
Programming
Software Development
15 Years Ago
by rimorin
Oh i see ... Try it and it works.. My mistake .. Never knew that Notepad can't read \n I'll try using System.getProperty("line.separator") then .. Thanks masijade
Re: FILEOUTPUTSTREAM and FILEINPUTSTREAM
Programming
Software Development
15 Years Ago
by masijade
Do [i]what[/i]? That is simply a statement of what those classes are for.
Cannot Find File Exception
Programming
Software Development
16 Years Ago
by algorion
…at java.io.
FileOutputStream
.<init>(
FileOutputStream
.java:179) at java.io.
FileOutputStream
.<init>(
FileOutputStream
.java:131) at…afile.renameTo(bfile);
FileOutputStream
fos = new
FileOutputStream
(new File("../log/server.log"));
FileOutputStream
fos2 = new
FileOutputStream
(new File("../…
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
Backlink Auditor
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC