filestream

how to set to NULL all the filestream varbinary(max) fields?

I need to create a test database out of a huge database where the most data is contained as filestream data. I need to test not filestream related data, so what I'd like to do is to remove the varbinary(max) info. These are the fields I have in my FILE_REPOSITORY_TABLE table: [ID_FILE] [int] NOT NULL, [FILE_DATA] [varbinary](max) FILE...

How to force the filestream garbage collector to complete its work with the highest priority?

After asking this question it is clear to me that I need to be able to perform the garbage collection in the fastest possible time. How is it possible to tell SQL Server filestream's garbage collector to delete all the files with high priority? I tried with the CHECKPOINT statement, even by setting a duration (CHECKPOINT 100), but noth...

How to read the current machine NTFS settings?

Before inserting filestream data I'd like to check the following NTFS settings: 1) 8.3 naming status (this is disabled by using fsutil behavior set disable8dot3 1) 2) last access status (this is disabled by using fsutil behavior set disablelastaccess 1) 3) cluster size (this is set with format F: /FS:NTFS /V:MyFILESTREAMContainer /A:...

How to prevent stdin stream from reading data from associated file descriptor on program start?

I'm using select() call to detect input presence in the main cycle of my program. This makes me use raw file descriptor (0) instead of stdin. While working in this mode I've noticed that my software occasionally loses a chunk of input at the beginning. I suspect that stdin consumes some of it on the program start. Is there a way to prev...

C#: Opening a Word File in a FileStream for reading while it is opened in Word

I am trying to open a Word file for reading using a FileStream in C#. I hacked a quick sample application which consists of a textfield and a button to trigger the creation of the stream. The sample Code to open the file is the following: if (File.Exists(this.TxtPath.Text)) { Stream s = new FileStream(this.TxtPath.Text, FileMode...

monitoring a file for changes

I'm trying to achieve tail-like functionality in my Visual Studio 2008 C++ application. (i.e. show in real-time the changes to a file not owned by my process.) /// name of the file to tail std::string file_name_; /// position of the last-known end of the file std::ios::streampos file_end_; // start by getting the position of the end o...

Adobe AIR: Windows Application Directory Access

While I realize Adobe discourages use of the application directory for reading/writing, I have been able to successfully write data there on OSX, so long as the user selected the file. However, this same application is giving me trouble in Windows 7. Even a browseForSave() doesn't seem to allow the FileStream to write to the file. Is t...

C# - FileStream and creating folders

Hi everyone Just a quick question. I'm using something like this FileStream fs = new FileStream(fileName, FileMode.Create); I was wondering whether there was a parameter I could pass to it to force it to create the folder if it doesn't exist. At the moment an exception is throw if folder isn't found. If there is a better method then...

C++ Why won't my sample program create the output file?

I'm writing a small/beta testing program that will be put to use in my much bigger program for a project. It requests the user for an input file name (IE data.txt) and creates an output file named filename.out (IE data.out). I've tried a simple outFile << "text here"; to try it out but it doesn't create output file. I'm sure I'm messing...

Entity framework 4 and sql filestream to read a file from db

Hi there, I'm using ASP.NET 4, EF 4 and FILESTREAM in SQL 2008 to add/read files to the DB. I'm able to upload files just fine, but I'm not able to retrieve the files the way I want to. Here's what I'm doing - I have a grid which displays a list of files. Each line item is a file with a CommandName and CommandArgument set. The user c...

reading characters from a file

i want to read a file one character at a time and write the contents of first file to another file one character at a time. i have asked this question earlier also but didnt get a satisfactory answer..... i am able to read the file and print it out to std o/p.but cant write the same read character to a file. ...

FILESTREAM file manipulations

Our application stores user files on the physical drives (alebit a large number of them). The files are organised and grouped into folders (one folder for each user). The application also manipulates the folders by creating sub folders within it and grouping files into those subfolders. The physical location of each file is stored in the...

Rails3 generating and streaming large files

Hello, my Rails3 Application has a certain request which generates a large CSV (20mb+) on the fly, and then prompts the user to download the file (while it is being generated). I've noticed while upgrading from Rails 2.3.x using "render :text => proc" no longer works. I am now working on a solution that will let me keep things working i...

Is the offset parameter of FileStream.Read zero-based?

The second parameter of the FileStream.Read method is called offset but is it zero-based like an index or does it start from one? ...

Convert a Stream to a FileStream in C#

Hi, What is the best method to convert a Stream to a FileStream using C#. The function I am working on has a Stream passed to it containing uploaded data, and I need to be able to perform stream.Read(), stream.Seek() methods which are methods of the FileStream type. A simple cast does not work, so I'm asking here for help. Thanks. ...

Which problems can be there in using win32 applications that handle office 2010 64 bit files?

I am testing one application that handles files (stored in sql server using filestream). It is a Delphi win32 application. Opening a xls document stored in the db (originally saved with Office 2003) gives an error from Excel 2010 64bit. Is there some known compatibility issues with Office 2010 64bit with win32 applications? i am tryi...

simultaneous read-write a file in C#

I have a file containing data that I'd like to monitor changes to, as well as add changes of my own. Think like "Tail -f foo.txt". Based on this thread, it looks like I should just create a filestream, and pass it both to a writer and reader. However, when the reader reaches the end of the original file, it fails to see updates I wr...

Best strategy for storing documents in SQL Server 2008

One of our teams is going to be developing an application to store records in a SQL2008 database and each of these records will have an associated PDF file. There is currently about 340GB of files, with most (70%) being about 100K, but some are several Megabytes in size. Data is mostly inserted and read, but the files are updated on oc...

Reading binary file from sdcard using Stream classes in android.

Hello guys, Can anybody have any idea how to read a binary file which resides in sdcard using Streams, like Inputstream, CountingInputStream or SwappedDataInputStream? I am using these three streams to read a file which is currently in the Resouces folder, but now i want to move that file in sdcard but I cannot change these stream beca...

I need to create an ashx httphandler to display images from SQL Server 2008 using SQL FILESTREAM

Hi Guys, I'm trying to create an ashx httphandler to display images from SQL Server 2008 using SQL FILESTREAM. Does anyone have an example of the web.config setting and ashx code needed to do this? Thanks! Richard. ...