file

A question regarding Android File I/O API?

I need to write multiple blocks of the following chunk into a file +----------+--------------+---------------------+ | FileName | Size of File | Binary Dump Of File | +----------+--------------+---------------------+ There are two variants of file writers I could see. 1. FileWriter - allows writing [string,char[],one byte] 2. BufferF...

How to include the Zend framework?

I'm on windows 7 with wamp and I don't know where to put the zend framework, as I know I need to change the path of the include_path but I don't know what should that be to work. I get this error when I open the test files or anything withing the zend files: Warning: require_once(PHPUnit/Framework.php) [function.require-once]: ...

Learning from Linux log files

Hello, I was wondering about the utility of storing metadata (Abbreviation Expansion, Brief Message, links to online resources) associated with messages, in /var/log/syslog, /var/log/kern.log etc. For instance, for a message like ACPI: Processor [CPU1] (supports 8 throttling states) I would search online about CPU throttling, and sto...

In C, how should I read a text file and print all strings

I have a text file named test.txt I want to write a C program that can read this file and print the content to the console (assume the file contains only ASCII text). I don't know how to get the size of my string variable. Like this: char str[999]; FILE * file; file = fopen( "test.txt" , "r"); if (file) { while (fscanf(file, "%s",...

Lost file extensions in Zend Studio 5.5.1 on Windows 7

I managed to get Zend Studio 5.5.1 running on Windows 7 by running in Vista compatibilty mode and it works fine, except, I have lost the file types/extensions I can add them again and the editor will open them, but I dont have any code completion or code coloring or anything Ive tried php, .php, *.php Anyone come across this and know ...

Register to be default app for custom file type

Register to be able to open files of custom type. Say i have .cool files, and if the user tries to oepn it, Android asks if they would like to open it with my application. How? ...

What is tsr file.

Hi, i have a requirement to export data to tsr file only. Previously we used to export to csv file. Can anyone tell me what is tsr file and what is the content format? Is the contents in someway similar with csv? ...

How can I pass a solution resource as a FileStream object (to an intercepted File.Open command)?

I extend upon a legacy library which accesses files on the harddrive. I have such files as embedded resources in my unit test project. I have ported parts of the library to accept streams, which allows me to use GetManifestResourceStream to pass my embedded resource to the legacy library. This works fine, but it is a slight hassle. And...

How to use properties notation in a Hibernate XML configuration file

This is still a pending question. Hopefully, one day I'll get an answer. Thanks to all who replied. My question is simple. How do I use ${catalina.home} or ${catalina.base} property inside a Hibernate XML configuration file? Here's my sample configuration file: <hibernate-configuration> <session-factory> <property name="dialect">...

Applescript testing for file exist

OK, I thought this would be a simple one, but apparently I'm missing something obvious. My code is as follows: set fileTarget to ((path to desktop folder) & "file$") as string if file fileTarget exists then display dialog "it exists" else display dialog "it does not exist" end if Easy right? Unfortunately, when I run the scri...

Playing an mp3-file with libsox

Hi all, I have an application in which I need to play an mp3 file. What I'm looking for is some kind of wrapper functions for libsox (or any other audio lib). I have been looking all over the net but have not found any option that is fast to implement. I'm looking for something like; bla=open_file("/mnt/music/my_music.mp3") play_thefil...

How to identify the file type of a file?

hello how to identify the exact file type of a file for better understanding i am giving some more details: for example if i have a file named as "example.exe" then i can easily recognize that it's an windows executable file(by seeing the extension .exe)but if i remove the extension(.exe)then by seeing i am not able to identify t...

ASP.NET MVC slow image loading through MVC framework?

On some photobook page i want to show appr 20 thumbnails. These thumbnails are programatically loaded from a database. those thumbnails are already resized. When i show them the images load kinda slow. some take 0.5 seconds to load some wait for 2 secons. The database doesn't matter because when i remove the database layer, the performan...

how to write a file without allocating the whole byte array into memory?

This is a newbie question, I know. Can you guys help? I'm talking about big files, of course, above 100MB. I'm imagining some kind of loop, but I don't know what to use. Chunked stream? One thins is for certain: I don't want something like this (pseudocode): File file = new File(existing_file_path); byte[] theWholeFile = new byte[file...

How to update an ini file with php?

I have an existing ini file that I have created and I would like to know if there was a way to update a section of the file or do I have have to rewrite the entire file each time? Here is an example of my config.ini file: [config] title='test' status=0 [positions] top=true sidebar=true content=true footer=false ...

How to parse data in a variable length delimited file?

I have a text file which does not confirm to standards. So I know the (end,start) positions of each column value. Sample text file : # # # # Techy Inn Val NJ Found the position of # using this code : 1 f = open('sample.txt', 'r') 2 i = 0 3 positions = [] 4 for line in f: 5 if line.find('#') > 0: 6 pr...

creating .bat file for java

I need to create a .bat file to run java program. I have a DatabaseConnect.class file under "C:\Program Files\Java" directory. And I have a jar files for database connection in "C:\Program Files\JarColl" directory. I tried but no success . ANy help is appreciated. ...

Read a .Z file (unix compresses file) in Java

Hello, The said file extension is explained here at http://kb.iu.edu/data/abck.html. I want to use a java api to read the contents of a Z file. Neither the ZipFile api or the GZIPInputStream seem to work. I can use the ZipFile api to open normal .zip files. ZipFile zf = new ZipFile("CR93H2.Z"); Enumeration entries = zf.entries(); To...

WiX: InstallService conditionally, but install file unconditionally

In Windows Install XML toolset, to install a service, we group <ServiceInstall> with a <File> in a <Component>. To conditionally install the service, we put <Condition> under the <Component>. However if the condition is false, the file will not be installed too. If I put the <File> in an unconditional <Component>, then the service has no...

Which is quicker; Comparing text against an array, or an external file?

I have to implement a "bad words" filter on my website, which is a classifieds website. I have a big list of "bad words" but don't know which method is best to compare the user inputs to. In my case, a textarea inside a form, needs to be checked for "bad words". <form name="test" action="test.php" method="post"> Inside test.php I...