file

Android: Getting lastModified of a private file

Hi Guys, I am trying to get the last modified date of an internal file and it always returns me 0 although I could read the file properly. Can you please let me know if I am doing anything wrong... Creating a file... FileOutputStream Os = activity.openFileOutput("file1.jpg", Context.MODE_PRIVATE); cachedImage.compress(CompressFormat.J...

Complexity of getting a file C#

Im thinking of storing a large number of files in a folder and load them into my C# program. The problem I thought about was the performance when loading a file to read from, from a folder that contains very many files. Will the time to load and read from a file be about the same when there is one file in the chosen folder or one million...

Loading tiles for a 2D game

Hi Im trying to make an 2D online game (with Z positions), and currently im working with loading a map from a txt file. I have three different map files. One contains an int for each tile saying what kind of floor there is, one saying what kind of decoration there is, and one saying what might be covering the tile. The problem is that t...

How write a file to STDIN Stream using DELPHI?

Hi, I need to write a FILE to STDIN. This FILE going to be accessed by another EXE that goig to write the STDIN stream in a microcontroller. Could you give me a help how to write the file to STDIN using Delphi 2010? Thanks very much! Abraão ...

reading .key file android

I have problem when i try to read a .key file. This file is created by a normal java (J2SE) and i read it from android application. When i read this file from android it gives me nothing and i have done some debugging and i noticed that it can't read the file. Also i have checked if i can read the file (using file.canRead()) and it appea...

Write NSImage to file

Hi, I have an NSImage from NSImage *myImage = [[NSBitmapImageRep alloc] initWithFocusedViewRect:[outputView bounds]]; and I need to save it to a file. I havent been able to find anything about saving NSImage in any format. Has anyone done this? Is it even possible? Thanks ...

How do I efficiently fill a file with null data from python?

I need to create files of arbitrary size that contain no data. The are potentially quite large. While I could just loop through and write a single null character until I've reached the file size, that seems ugly. with open(filename,'wb') as f: # what goes here? What is the efficient, pythonic way to do this? ...

Registering file types with Silverlight OOB application

Hello, In olden days of MFC and WinForms applications, you could register a file type with your application, and then double clicking that type of file in windows explorer would open that file in your application. I have a situation where I need to implement the same for an out of browser silverlight application, but I am unable to find...

creating a build file with ant

I am trying to work through the HelloWorld example on the Web that shows you how to create a build file using ANT in Eclipse. This is the project build file from the web example <?xml version="1.0" encoding="UTF-8"?> <project name="HW.makejar" default="makejar" basedir="."> <target name="makejar" description="Create a jar for th...

Deny requests of any file without authentication

Hi guys. Try to access this image: https://mail.google.com/mail/pimages/2/up/buzz-icon2.png Gmail doesn't allow your request and redirect you to login, after that you will be able to see the image. I use php + nginx + fastcgi + mongodb and can't do this trick with sessions (not with images) or http authentication (user's password mus...

shape file (GIS) to text

How I can convert a shape file (GIS) to text? or, How I can extract the information in a shape file? ...

C# Deleting files

In my codebehind I'm currently saving documents to a folder on the server. If the document is temporary I append "_temp" to the filename. On page load I want to check the server folder where these documents are held and I want to delete any of the temporary documents. i.e. the files that end with "_temp". What would be the best way to d...

Using a video file instead of iPhone camera

Hi guys Yesterday I posed the question of why the Apple WWDC 2010 samples for the iPhone camera dont work in the iphone simulator, http://stackoverflow.com/questions/3383928/iphone-video-access-samples That question was answered promptly. However as a follow up question I would like to know how to use video frames from a video file that...

Ignoring a directory chain in git?

I need to ignore the following. In paths like /a/b/c/d/e/f/g, I need to ignore /d/e/f/g. I also need to be able to ignore every place /d/e/f/g appears beneath a. I tried d/e/f/g, but that did not work. Thoughts? ...

Java detect changes in filesystem

I have a folder in which continuously new files are being dumped.In Java,what is the best way to detect changes in file-system (ie. a specified folder in which the files are being dumped) and add the newly arrived files to a queue data structure so that i can sequentially process each incoming file. I'm aware of listFiles() function in ...

help with IOError for reading files

for subdir, dirs, files in os.walk(crawlFolder): for file in files: print os.getcwd() f=open(file,'r') lines=f.readlines() writeFile.write(lines) f.close() writeFile.close() I get the error as:- IOError: [Errno 2] No such file or directory In reference to my partial python code abov...

In PHP, I need to make a POST request, but one of the variables must be a text file. How do I do it?

Here's what I need to do. In my PHP script, I need to make a POST request, but one of the arguments must be sent as a text file named data.txt. I already wrote a little script that will send the POST request and send the arguments. The server expects an argument that's an array with two elements, arg0 and arg1. arg0 is a regular string, ...

binary file encryption problem

hello all. i'm having a problem while encrypting some data in the file. i'm using simple xor for that. lets say i have this struct: struct MyFile{ char fileName[128]; int account; float balance;}; saving this as a binary file is working properly but when i use xor to encrypt the filename in the struct and save the struct to hd then re...

log JSP output to file

I'm not a java guy and I got some JSP code from a friend for testing purposes. All succes/faliure information is being output to browser, but the problem is - I'm not the one who is making the request. So Is there any simple way to copy/redirect default output of the JSP to a file on server but still finish the request? ...

Reading and comparing lines in a file using Python.

I have a file of the following format. 15/07/2010 14:14:13 changed_status_from_Offline_to_Available 15/07/2010 15:01:09 changed_status_from_Available_to_Offline 15/07/2010 15:15:35 changed_status_from_Offline_to_Away became_idle 15/07/2010 15:16:29 changed_status_from_Away_to_Available became_unidle 15/07/2010 15:45:40 changed_status_f...