files

Looking for a good way to write multiple virtual "files" to one system file

I have an application where there are multiple processes. They share the reading and writing of a set of files that grows over time. I'd rather not expose thousands of files to the user's environment, where it would be much easier for them to accidentally modify or delete one of them. Is there an API that will allow reasonably high perfo...

TSearchRec with progressbar

I've this procedure to search for files , But what i want to add is the progressbar feature; the progressbar will move along with procedure . procedure TfrMain.FileSearch(const PathName, FileName : string; const InDir : boolean); var Rec : TSearchRec; Path : string; begin Path := IncludeTrailingBackslash(PathName); if FindFirst(P...

Javascript object dependencies

In complex client side projects, the number of Javascript files can get very large. However, for performance reasons it's good to concatenate these files, and compress the resulting file for sending over the wire. I am having problems in concatenating these as the dependencies are included after they are needed in some cases. For instan...

Silverlight: How to open a system application to open a file.

I want to create a silverlight application by providing the URL of a file, then it opens the right system application. Example: if the file is .pdf - it opens acrobat reader .doc - opens winword ...

What is the fastest way to load a text file to an access Database ?

I have Text file that contains data separated with a comma ,. How do I load this to access in the fastest way? The Text file contains 200,000 rows. I work with C#. ...

Remove identical files in UNIX

Hi all, I'm dealing with a large amount (30,000) files of about 10MB in size. Some of them (I estimate 2%) are actually duplicated, and I need to keep only a copy for every duplicated pair (or triplet). Would you suggest me an efficient way to do that? I'm working on unix. Thank you :-) ...

how to make a folder for the files placed in listview in c#.net ?

whats the procedure to send the files placed in a listview to a folder.. that is... i need to place all the files in the listview to a folder on button click event.. on button click it should make a folder for all the files in the list view and send them in.. im using winforms in c#.net ...

Polymorphic Paperclip overwriting files with the same names

Hi, in Rails using the Polymorphic version of Paperclip, the default saving technique means that files with the same name overwrite each other. Including the :id in the path and URL doesn't work as it just overwrites the earlier file with the old :id. I've tried interpolations using a time-stamp, but it just looks for the current time w...

how can i send the listview files to the directory using c#.net?

i have the files situated in the listview now i want to copy those files to a directory in windows.. how this action can be performed?? ...

PHP - move_uploaded_file doesn't work for music/video

Hey, I'm working on a upload script and using move_uploaded_file() function. The problem is, that it only works for .txt, .jpg, .psd and some other file types I've tryed, but not for .mp3, .mov, .avi and maybe others. There is nothing to the script, it's just the function. An interesting thing is, that it doesn't show any error msgs, i...

Practical to save thousands of data structures in a file and do specific lookups?

There's been a discussion between me and some colleagues that are taking the same class as me (and thus have the same project) about saving data to files and read from those files only when we need that specific data. For instance, the project is something about managing a social network. I'm not going into specifics because it doesn't ...

How to store files or images on the file system?

I am working on project -online file management where we have to tore file and images.so we are in confusion state that whether we use file system or database to store file and images;;;;; ...

Uneditable file and Unreadable(for further processing) file( WHY? ) after processing it through C++ Program

Hi...:) This might look to be a very long question to you I understand, but trust me on this its not long. I am not able to identify why after processing this text is not being able to be read and edited. I tried using the ord() function in python to check if the text contains any Unicode characters( non ascii characters) apart from the ...

Is there a way to do relative path references from a superclass?

Hello guys, I'm developing two Ruby gems, one is a framework, the other is an application. My main app's class inherits from a framework's class. The class defined in the framework have some file loading methods that rely on __FILE__ so subclasses can load resources relative to their path. What I want is for the subclasses to be able ...

Kohana3: Absolute path to a file

Say I have a file in my kohana 3 website called assets/somefile.jpg. I can get the url to that file by doing echo Url::site('assets/somefile.jpg'); // /kohana/assets/somefile.jpg Is there a way I can get the absolute path to that file? Like if I want to fopen it or get the size of the file or something like that. In other words, I ...

Is cin a proper file object?

As in, can I pass cin to any function that accepts an ifstream object? ...

Bash: how to supress newlines?

I'm trying to extract fields from a pipe-delimited file and provide them as arguments to an external program in a loop. The file contains lines like this: value1|value2 value3|value4 So I came up with: while read line; do echo -n "${line}" | awk -F '|' '{print $1}'; echo -n " something "; echo -n "${line}" | awk -...

Save memory in Python. How to iterate over the lines and save them efficiently with a 2million line file?

I have a tab-separated data file with a little over 2 million lines and 19 columns. You can find it, in US.zip: http://download.geonames.org/export/dump/. I started to run the following but with for l in f.readlines(). I understand that just iterating over the file is supposed to be more efficient so I'm posting that below. Still, wit...

ansi-c fscanf problem

hi i read the file as follows fscanf(fp,"%f %f %f\n",&*(p1+i), &*(p2+i), &*(p3+i)); my file's lines consists of three floating point numbers... the problem i have is that in the file let's say i have some floating points with let's say maximum of two digits after the dot. but when i ask c to print those values using different ...

How can I count paragraphs in text file using Perl?

I need to create Perl code which allows counting paragraphs in text files. I tried this and doesn't work: open(READFILE, "<$filename") or die "could not open file \"$filename\":$!"; $paragraphs = 0; my($c); while($c = getc(READFILE)) { if($C ne"\n") { $paragraphs++; } } close(READFILE); print("Paragraphs: $paragraphs\n"); ...