file

Intelligent file copy algorithm (os independent)

Hi, I'm trying to create, a fast and somewhat intelligent file copy algorithm (in c# but platform independent). My goals: I don't want to use any platform specific code (no pinvokes or anything) I'd like to take advantage of multiple cores but this seems stupid since doing simultaneous reads/writes would seem slower right? (correct ...

Detecting duplicate binaries in the same directory (Windows)

Hello! I have about 30 files in a directory varying from 64KB to 4MB that are BIN files. I need to find if there is duplicate files in there... Many files have the same size. I would like to find if there are binary identical files in there. Anyone know a way to do this? I'm under Windows XP Pro. Thanks! ...

Not writing to file, but no errors PHP

I am trying to write data from form inputs to a text file using PHP. The file seems to load correctly, but does not write the data. I have echoed the input values directly before trying to write to ensure they are not empty. The text file is in the same directory as the php file. I orginally got the error "Warning: fwrite(): supplied...

How do I enable FFMPEG logging and where can I find the FFMPEG log file?

I want to be able to log FFMPEG processes because I am trying to work out how long a minute of video takes to convert to help with capacity planning of my video encoding server. How do I enable logging and where is the log file saved. I have FFMPEG installed on a CentOS LAMP machine. ...

Can C's fgets be coaxed to work with a string *not* from a file?

Specifically, the code sample here works great, but only when the string is stored in a file. Sometimes I need it to process a generated string (stored in a string variable), but I'm having trouble convincing fgets's third parameter to work with string variables because it's a pointer to a FILE structure. Or perhaps there's a functio...

File Processing

I'm writing a game in which user can create his own level and remove them also. The only trouble is that I want files to be saved with names as level1, level2, level3 etc without asking user name of level. While saving a game with level5 name it might be possible that any previous level with that name already exists. Is there any way to...

Write all bits in C#

Hi How can i write all bits of a file using c#? For example writing 0 to all bits Please provide me with a sample ...

Read from file, clear it, write to it

I'm trying to read data from a text file, clear it, and then write to it, in that order using the fstream class. My question is how to clear a file after reading from it. I know that I can open a file and clear it at the same time, but is there some function I can call on the stream to clear its contents? ...

Cut files to clipboard in C#

Hi, I'm looking for a way to programmatically cut a file to the clipboard, e. g. some call to a function in C# that does the same as selecting a file in the Windows Explorer and pressing Ctrl+X So after running the program and pressing Ctrl+V in some other folder on the hard drive, the original file would be MOVED to the new folder. By l...

Reading specific lines only (Python)

I'm using a for loop to read a file, but I only want to read specific lines, say line #26 and #30. Is there any built-in feature to achieve this? Thanks ...

[VB.net] resource file

Hi, How can i use a .exe file in my resources folder? I want to copy the file in the resource folder to another folder. tried this Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If (Directory.Exists("Files")) Then Else End If Directory.CreateDirectory("Files"...

Upload text file on FTP server using iPhone

I have implemented code for uploading images and directory to FTP using iPhone. But I need to upload text file on FTP using iPhone. Can you please send me code for that. ...

How to upload a file in asp.net without reloading a page

How to upload a file in asp.net without reloading a page ...

Nasty unicode and C++: Easy way to read ASCII/UTF-8/UTF-16 BE/LE text file

Hello everyone, sorry if the question is stupid and has been asked thousands of times but I spent a few hours googling it and could not find an answer. I want to read in text file which can be any of these: ASCII/UTF-8/UTF-16 BE/LE I assume that if file is unicode then BOM is always present. Is there any automatic way (STL,Boost or so...

File creation time

How do I sort a directory by file creation, latest first in PHP 5.2? I am on Windows 2000. ...

Force rename a file in Java

Can I use any utility to do a force rename of a file from Java.io? I understand that Java 7 has these features, but I can’t use it... If I do a File tempFile = File.createTempFile(); tempFile.renameTo(newfile) and if newfile exists then its fails. How do I do a force rename? ...

PHP - include PART of a file - how??

i want to have ONE file from which PHP can source content text such as title, marquee and other small updates. i think i remember something like this in asp where you can point asp to a line on a text file and it will pluck it out. help!! thanks. dan ...

(IPHONE) Big confusion to read/write the same file from resource folder

hi all, i've read several thread for this question but unfortunatly not found the answer to my problem :( i have a xml file in resource folder, and i need just to re-write the same file; the app logic is: display data loaded from file add new data to the same file for read a file my code is: NSString *filePath = [[NSBundle mainBund...

How to read from file, which name is "-"

Hello, how to read content of a file which name is "-" (dash, not stdin)? ...

Sort a file with huge volume of data given memory constraint

Points: We process thousands of flat files in a day, concurrently. Memory constraint is a major issue. We use thread for each file process. We don't sort by columns. Each line (record) in the file is treated as one column. Can't Do: We cannot use unix/linux's sort commands. We cannot use any database system no matter how light t...