Questions tagged [filestream]

In .NET framework filestream exposes a Stream around a file, supporting both synchronous and asynchronous read and write operations. ActionScript 3 for AIR 2 and above also uses FileStream, which supports both synchronous and asynchronous read and write operations.

2765 questions
10
votes
1 answer

FileSystemWatcher triggers for filestream open

I have a filesystemwatcher that will trigger an event when a file is modified. I want to read from that file once the lock has been removed. At the moment I am just trying to open the file once the event is triggered, when A large file is being…
Matthew
  • 217
  • 1
  • 2
  • 9
10
votes
5 answers

iTextSharp + FileStream = Corrupt PDF file

I am trying to create a pdf file with iTextSharp. My attempt writes the content of the pdf to a MemoryStream so I can write the result both into file and a database BLOB. The file gets created, has a size of about 21kB and it looks like a pdf when…
Norbert
  • 4,239
  • 7
  • 37
  • 59
10
votes
4 answers

How to read character in a file 1 by 1 c#

I want my program to read a text file all characters 1 by 1 and whereever it finds a double-quote ("), it adds a semicolon before that inverted comma. For eg we have a paragraph in a text file as follow: This is a paragraph which conains lots and…
Sam
  • 105
  • 1
  • 1
  • 6
10
votes
2 answers

How do I get the name of a file generated with a stream in C#?

I'm building a Windows 8 metro app with XAML/C#. I'm saving an .xml file my data structure with a stream, like this: XmlSerializer serializer = new XmlSerializer(typeof(MyObjectType)); using (var stream = await…
Federinik
  • 523
  • 4
  • 20
10
votes
1 answer

JPEG data-stream to TImage

I have some image-files stored into one file (some kind of archive). That file looks like this: Well, it's separated into two segments - header and data-segment. Header (green) contains various info, such as album name, location, date/time,…
Wh1T3h4Ck5
  • 8,399
  • 9
  • 59
  • 79
9
votes
2 answers

How-To: Validate a FileStream is a valid PDF document with .NET

Possible Duplicate: Detect if PDF file is correct (header PDF) I want to validate that the data in a FileStream instance represents a valid PDF document. Specifically, I need to know that Adobe Reader will be able to successfully open the…
smartcaveman
  • 41,281
  • 29
  • 127
  • 212
9
votes
1 answer

FileStream not closing file

I have the following code: using (MemoryStream str = new MemoryStream()) { Program.api.GetDocument(result, str); using (FileStream fileStream = File.Create(filePath)) { …
Chris
  • 7,415
  • 21
  • 98
  • 190
9
votes
1 answer

SQL Server PDF Full-Text Search not working on FileStream PDF File

I cannot get the Full-Text search to work on PDF files I am loading into my SQL Db via FileStream. Version: SQL Server 2008 R2 (Developer Edition - doing proof of concept) OS: Windows 7 Steps I have taken. Installed the Adobe iFilter Made sure…
scarpacci
  • 8,957
  • 16
  • 79
  • 144
9
votes
6 answers

Looping through lines of txt file uploaded via FileUpload control

I want to select a simple .txt file that contains lines of strings using a FileUpload control. But instead of actually saving the file I want to loop through each line of text and display each line in a ListBox control. Example of a text…
PercivalMcGullicuddy
  • 5,263
  • 9
  • 46
  • 65
9
votes
2 answers

inotify - how to find out which user has modified file?

I'm looking for guidance on how to find out which user has modified a particular file. While inotify is great to get notification when a particular file is touched, how do I figure out which user has modified that file? I can think of using lsof but…
user837208
  • 2,487
  • 7
  • 37
  • 54
9
votes
3 answers

Python command line 'file input stream'

I'm fairly new to python coming from C/C++, I was wondering how I would get my 'main.py' to reconize/use the imput given from a bash shell as: python main.py < text.txt (the file is in plain text)
Tyler Wall
  • 3,747
  • 7
  • 37
  • 52
9
votes
2 answers

Strange behavior with FileStream.WriteFile

I'm working on a program that does heavy read/write random access on huge file (till 64 GB). Files are specifically structured and to make access on them I've created a framework; after a while I tried to test performance on it and I've noticed that…
Atropo
  • 125
  • 8
9
votes
1 answer

operator precedence (void* before bool?)

When answering this question I made some research which really confuses me. I noticed that two ifstreams that succesfully open are not equal but two ifstreams that fail are. At first i checked cplusplus.com. The operator ! returns the status of the…
default
  • 11,485
  • 9
  • 66
  • 102
9
votes
2 answers

How to Access File Descriptor of Open File

Is there any way to access the file descriptor of a file opened in c++? So ... #include #include using namespace std; int main() { ifstream inputFile( "file.txt",ios::in ); cout << inputFile.fileDesc <<…
Dan Snyder
  • 1,483
  • 7
  • 20
  • 29
9
votes
4 answers

XmlDocument.WriteTo truncates resultant file

Trying to serialize an XmlDocument to file. The XmlDocument is rather large; however, in the debugger I can see that the InnerXml property has all of the XML blob in it -- it's not truncated there. Here's the code that writes my XmlDocument object…
Brad Heller
  • 1,551
  • 5
  • 18
  • 29