Search code examples
c#file-iofileinfo

is it possible to create an in-memory file and access it with FileInfo?


I want to FTP a file, and I am using the FileInfo class for certain things.

Would it be possible to create an in-memory file and initialize FileInfo with it?

How could I then write the file to disk if I wanted to afterwards?


Solution

  • I don't believe so. FileInfo's constructor will only expect a path, not a stream. I think your going to want to use the StreamReader class...