files

Iterate through files and read records

What is the fastest way to the following in C# 3.5 : Iterate through files in a directory Read the file's records (fixed length of 247 characters) Convert the fixed length string of each record to a Struct or Class. Thanks ...

Read large files in Java

Hi guys. I need the advice from someone who knows very well java and the memory issues. I have a large file (something like 1.5GB) and I need to cut this file in many(100 small files for example) smaller files. I Know generally how to do it (using a BufferedReader), but I would like to know if you have any advice regarding the memory, o...

How can I iterate through files in Javascript

Hi, Is it possible to iterate through a collection of files in Javascript? I am writing a jQuery plugin that takes either an array of images or, I was hoping, a directory containing a list of images. E.g. either: ['image1.jpg','image2.jpg','image3.jpg'] or 'http://somedomain.com/images/' I would then like to be able to iterate thr...

fgets from stdin problems [C]

I'm writing a program that works with files. I need to be able to input data as structures, and eventually read it out. The problem i have at the moment is with this code: typedef struct { char* name; ..... }employeeRecord; employeeRecord record; char name[50]; if(choice == 1) { /*Name*/ printf("\nEnter the...

Getting results of perl -w tag into a file

Is it possible to add the -w tag to the first line of a perl program, then run the program from a shell like bash or dos and write all of the warnings into a file? perl somescript.pl > somefile.txt This is a throwback to desk checking COBOL programs at school. I'd like to have all of the warnings in front of me on a piece of paper so ...

Expiry date as a file attribute or in a separate file for a Caching Mechanism

I'm creating a simple caching library in PHP. Currently, when I store a value I create 2 files: One that contains the value and another one to store the creation time. I want a robust solution and I'm not sure how safe it is to use the file date attributes. Do you think is safe to use the file date attribute for expiry time, instead to s...

Comparing two lists items in python

Hi, I have two files which I loaded into lists. The content of the first file is something like this: d.complex.1 23 34 56 58 68 76 . . . etc d.complex.179 43 34 59 69 76 . . . etc The content of the second file is also the same but with different numerical values. Please consider from one d.complex.* to another d.complex.* as one set...

How to list source code file names at Java run time ?

When my program starts to run, how do I list available java source file names ? For example, I have a few dozen source files named "My_App_*.java" in my src directory, after I start my app, how can I call Java to list source files start with "My_App_" dynamically ? Frank ...

how to delete a file via PHP

Hi, how do I delete a file e.g 22.pdf from my server with php if the file is in an other directory page layout: projects/backend/removeProjectData.php (this file deletes all my entries for the database and should also delete the related file) public_files/22.pdf (the place where the file is located) now I'm using the unlink('../../p...

xcodeproj files

The below files have nothing to do with the project settings, right? It is just properties for the Xcode IDE. *.mode1v3 *.pbxuser ...

IPOD Touch and pdf files

Can ipod touchs store pdf files and open them without any internet connection? My friend just bought one and he could not explore a feature like that yet. he say that i-tunes does not allow transfering pdf files to ipod touch. ...

How can I get Eclipse to store .class files in a folder outside the Project folder where I store the .java source files?

Per this question (see comments near the bottom), I was wondering if anyone knows any way to get Eclipse to store .class files in a folder of my choosing outside the project folder where the .java source files are stored. I have not seen an option to do this in the new project creation wizard, but my knowledge of Eclipse is quite limited...

Best way to store application data when data stored and data format could change in future versions?

I'm making an Android Java app game (although this question applies to all languages really) and hope to release the first version soon. I'm nervous about how I save data in my game. My problem is that, if in a later update, I decide to store more data or store the same data in a different way, I need to be careful I don't lose or corrup...

How to store the contents of an array into a CSV file and save it in a location in php

Hi, I have an array which has the contents as the result of an sql query. I have been able to convert them into a CSV as well in the below format 2; Testing; IPTV; 9886784; 50061; 28/2/10 09:30:01 AM; 3; Testing; IPTV; 9886784; 50061; 1/3/10 09:30:01 AM; 4; Testing; IPTV; 9886784; 50061; 2/3/10 09:30:01 AM; 5; Testing; IPTV; 9886784; ...

Directory printing tool?

I have a very complex web app project I want to re-structure. Naturally, it consists of a considerable number of folders and sub-folders. I have a huge piece of paper ready to sketch a new structure on. Now, I need paper printouts of the projects. Some directories I need in full detail including their files - the /library directory for ...

how to Open a new instance of jEdit?

I'm new to jedit, and I haven't yet found out how to open a new window. For example, I want to be editing one set of files in one space on my Mac, and edit a different set of files in another. Does anyone know how to open a new instance/window of jedit to make this possible? Thanks ...

Location of NHibernate Config Files in a modular application

Hi folks, I'm working on an application framework that is supposed to be mostly modular, meaning once the framework is done, all business intelligence is incorporated in plugins that can be included via config. Most modules have the common aspect that they use NHibernate to access a database, and often they use the same tables. What ...

How to read a block of n lines of a very big text file in both directions, using Java

I need to read a very big log file (about 400MB) and display its content in a textarea. Obviously I can't read the whole file first, because of its dimension, so I am looking for a method that can read the first n lines (or portion of bytes) and then, when asked, start reading the next n lines, and so on. The method needs to work in bot...

"Temporary Internet Files" folder on Windows

My Java program needs to delete any temporary internet files that were created by a "Shell.Explorer.1" ActiveX control created by the program. What is the best way to do that? If I go to Tools->Internet Options in Internet Explorer, click on the Browsing history Settings button on the General tab, and then click on the View files butto...

ASP.Net MVC2: Where can I store a file to be able to access it on both my dev box and in production?

I need to store a file, such that my ASP.Net MVC app can access the file, both when I run the website in visual studio, and when the production server is actually running. I don't think that I can do relative pathing on my dev box, because the execution path is something in the System32 folder. I don't know if the same is true on the ser...