file

How to read giant text file in PHP?

Hello, I have few text files with size more than 30MB. How can i read such giant text files from PHP? ...

WinAPI File In-/Output with std::strings instead of char arrays?

Hi, due to performance reasons I didn't feel like using fstream for just one time. Seems like a very bad idea to use WinAPI functions with a std::string instead of a plain char array. All in all I would like you to tell me why the following snippet just won't work (empty stBuffer stays empty) and what I'd need to do to get it fixed. Th...

Visual Studio 2008 always saves SLN file on exit

Got a bit of a weird problem. I'm checking a solution out of TFS source control, and not making any changes to it; just opening it using the SLN file. If I then close Visual Studio (or do a Save All), Visual Studio prompts me to save the SLN file. Even if I do (by overwriting it, it's a read-only file), it continues to do this every t...

Vim travel to pathfile determined in vimrc

How do I open a file specified in vimrc, with a key combination? ...

Drupal Attachments (FileField) file path

What function in Drupal gets file attachment path? Edit: the attachments provided by Upload module in system section. But since you mentioned there may be another way around it. Maybe I could achieve may goals using FileField module so if you could tell me how to get a direct link of a file uploaded by FileField module that may also be ...

Why is the FileInputStream read() not blocking?

Hi there, I've got a Writer program that writes one line of text to a file, then waits until the user hits return before it writes another line and then exits. Only after that is the file closed. The code: public class Writer { Writer() { } public static String[] strings = { "Hello World", ...

What should be the standard PHP code file lenth in LOC ?

I do PHP coding a lot in my company and personal work. Usually my files get bigger, sometimes more than 2000-3000 lines long. Then, they get difficult to manage. My Question: What should be (is) the standard length of a PHP code file in terms of lines-of-code. At what length do you guys split it up? Note: No Object Oriented programming...

Ruby: How can I read a regex from a file, then parse strings using that regex?

This is one of the most difficult things to search for because when you search how to parse a regex you get how to parse with a regex. I want to read a regex from a file, put it in an object somehow, then parse strings using that regex in my program. Im sure someone has done this before, can you help me out on where to start? ...

VB: Start from specific line for SQL INSERT

Hi everyone, I have a small VB program I am doing, however I have run into a problem I can't seem to figure out. Currently my code reads a file line by and line in a loop and does some processing stuff such as SQL INSERT, however the file I'm reading from has a large portion that is configuration at the top and the data at the bottom. ...

Qt : waiting for a file being closed by another process

Hi, I've a daemon (obexpushd) that writes some files in a directory. In my Qt application, I listen to changes in this directory thanks to QFileSystemWatcher. Yet, the directoryChanged signal is emitted when obexpushd creates the file, not when it has finished to write it. So, I've to wait for obexpush to finish writing the file before...

Strange bug when renaming a file with NSFileManager

I used to use the following to rename aplist file with various user inputted values (BOOL,Strings mostly): [manager moveItemAtPath:oldPath toPath:newPath error:&error]; And for some reason in iOS4+ this glitches out, so I Attempt the following: [1] [manager copyItemAtPath:oldPath toPath:newPath error:&error]; [2] [manager rem...

CMSMS File Download Problems

Hi, I'm using the CMS Made Simple platform; which I'm not very familiar with! The site has a secure frontend, which contains a document library for members. Files are stored outside the document root and links are generated by the CMS so you should only be able to get the documents if you're logged in. At first glance the setup works ...

Does fwrite call any lock internally?

In solaris when I attached dbx to one of the running stacks, I found the call to fwrite leading to __lll_lock_wait()? In what scenario will this happen? Does fwrite internally tries to acquire a lock? ...

Can fwrite & fclose be called parallely from two threads for the same file descriptor?

What will happen if fwrite & fclose are called in parallel from two threads for the same file descriptor? ...

Move all files of same type in multiple directories up one folder.

I have about 2000 subfolders in one folder, in each of these folders there are .pdf files. I need a unix command that will move all these files up one folder. ...

WPF. IsolatedStoreage FileName Length

Hello guys. For save my configuration_data I use isolated stoeage domain scope like: IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForDomain(); But sometimes at saving data I get: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.PathTooL...

Java -Check if file is in print Queue / In Use

Hey SO OK I have a program that: Creates a temporary file based on a users input Prints the File(Optional) Deletes the File (Optional) My problem sits between stages 2&3, I need to wait for the file to finish printing until I can delete it. FYI: the printing will take 5-10 minutes (large file to spool on an old computer) So I nee...

Parse a log file and get entry data

I have a big log file with multiple lines separated by new line. Each line entry stores four values. If I am reading the log file and want to store this information, what data type/object should I use? Example: source1 destination1 result time source2 destination1 result time sources3 destination2 result time The values are not uni...

Bash script log file rotation

My bash script produces a log file. Now i'd like to implement some log file rotation. Let's say the first time it's called somelog.log, the next time it's renamed to somelog.log.1 and the new log file somelog.log.The third time the new log is somelog.log again, but somelog.log.1 is renamed to somelog.log.2 and the old somelog.log to some...

Send a file through a POST request with http_socket in CakePHP?

Hi, I need to make a HTTP POST call to a Hudson CI server from CakePHP. The call is parametrized and contains a few key/value pairs. Some of those are in fact files which need to be uploaded. Since I'm using CakePHP, I'd rather use the HttpSocket class which comes with the framework rather then try and write my own cURL based implement...