Question c#

  • Thread starter Thread starter ross_smith
  • Start date Start date
R

ross_smith

Is it possible to replace a string path with a steam of some sort?
Here is an example: item.path = "filename.xxx" where you use some
method (streaming comes to mind) that allows me to actually stream the
file to item.path instead of having to write it out to the hard drive
first?
 
Ross,

How else are you going to get the file to the path? You ^must^ write
the file to the hard drive in order to, as you put it "stream the file to
the path".

You can't have a file on disk with a path without writing the file to
disk.
 
Is it possible to replace a string path with a steam of some sort?
Here is an example: item.path = "filename.xxx" where you use some
method (streaming comes to mind) that allows me to actually stream the
file to item.path instead of having to write it out to the hard drive
first?

MemoryStream whatever = new MemoryStream(); comes to mind, the
question and cap might be a clearer..
Question c# in microsoft.public.dotnet.languages.csharp is ...

$B%W%m%0%i%`$9$k$3$H$O:$Fq$G$"$k(B

//CY
 
Thanks for getting back to me.

I was hoping there was a way to wrap a memory stream (orf something)
around the process. So that the calling program would work as desired
but i could save the time it takes to write out and then read the file
again.

Thanks again.
 
I see what you are saying. There is no object representation for a path
(they are represented as strings) which would allow you to do this. If the
method/property took a Stream, then that would be great, as you could pass
it any number of derivations of Stream which would give you the
characteristics that you want. Unfortunately, it doesn't, so you will have
to resort to writing to a temp file or something of that nature and passing
that to your property.
 
Well, thanks anyway. Didn't think so but thought i would give it a
try. Never hurts to ask.

thanks
 
Thanks for getting back to me.

I was hoping there was a way to wrap a memory stream (orf something)
around the process. So that the calling program would work as desired
but i could save the time it takes to write out and then read the file
again.

Thanks again.

but

MemoryStream whatewer = new MemoryStream();
XmlTextWriter whateverXML = new XmlTextWriter(whatever,
Encoding.None);

normally goes

XmlTextWriter whateverXML = new XmlTextWriter(@"c:
\whatever.xml",Encoding.None);

its a ram drive ;)

//CY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top