file

Parse XML from String using XPath in Bada?

I have read the tutorial on XML parsing in Bada. But I don't want to use a file. I need to parse my XML from a Osp::Base::String. Any ideas which methods should I use? So far I have replaced xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { AppLog("Error: unable to create new XPath context"); xmlFreeDoc(doc); return(E...

Createfile function

I am creating the file using Createfile function. The C program is working fine but I am unable to see the created file in the respective folder. Also "view hidden files" option is checked. ...

Troubles with NSString writeToFile

I am using the following code to open a file's contents and save it to another file. when it runs the original file length is 793 but the saved file is 0. I have also tried just to copy the file. Nothing seems to work. Is there some kind of permissions I'm missing on the documents directory? NSError *error; NSString *basePath = [...

Read from a log file as it's being written using python

Hi, I'm trying to find a nice way to read a log file in real time using python. I'd like to process lines from a log file one at a time as it is written. Somehow I need to keep trying to read the file until it is created and then continue to process lines until I terminate the process. Is there an appropriate way to do this? Thanks. ...

Deleting files created with FileOutputStream

Hi, I'm developing for the Android platform. My app creates a temp file with a simple call to: FileOutputStream fos = openFileOutput("MY_TEMP.TXT",Mode); It works fine because I can write to it and read it normally. The problem is that when I exit from the app I want to delete this file. I used: File f = new File(System.getProperty(...

Programatically invoking the default application for a filetype

On a related note to this question, say I've got an file with an handler defined, how would I programatically invoke the registered handler? Don't necessarily need the actual code to do this, just a pointer to some docs or the terminology to google for this. Thanks, Chris ...

File Read/Write vs Database Read/Write

Which is more expensive to do in terms of resources and efficiency, File read/write operation or Database Read/Write operation ...

Reading and running Powershell file from text

Right now, I'm trying to use a Powershell script to read through a textfile and execute all of the Powershell scripts mentioned in it, but I can't get any results. I've tried specifying it this way: Start-Job -ScriptBlock{powershell.exe -noexit $val} -name $jobnum and this way: Start-Job -ScriptBlock{$val} ($val is the value of the li...

Can zip files and Images be stored in AppFabric cache

I would like to know, if i can store the zip files of Plist and Images in the AppFabric cache? If yes, how? Do we need to covert the zip files to binary format or some other format, so that it can be stored in the App Fabric. I am looking at storing the entire zip content in the AppFabric cache , so that the performance and the scalibil...

Reading files and writing to database in django

I have a Django app that opens a file, continuously reads it, and at the same time writes data to a Postgres database. My issue is that whenever I open a file, file = open(filename, 'r') I am unable to also create new things in the database, Message.objects.create_message(sys, msg) That should create a database entry with two str...

How do I parsing a complex file format in Delphi? (Not CSV, XML, etc)

It's been a few years since I've had to parse any files which were harder than CSV or XML so I am out of practice. I've been given the task of parsing a file format called NeXus in a Delphi application. The problem is I just don't know where to start, do I use a tokenizer, regex, etc? Maybe even a tutorial might be what I need at this...

Passing an AIR file to ActionScript as a FileReference?

Hello, This might be an awkward question, I apologize in advance. I made a program to upload files and it uses FileReference. I want to have an AIR version of this program, but allow to pick a whole folder. So far, I was able to get this behavior through AIR using AIRAliases.js in JavaScript. I am able to create File objects but I won...

How can I read an xml file from the users computer on an ASP.NET MVC2 site?

I am writing a website to consolidate a bunch of XML files with data into one MySQL database. I need to have a way to allow users to select a directory on their computer that contains a bunch of xml files. The site then reads each of those files and takes care of consolidating the information. Is there a simple way (like the default ope...

Java equivalent of C# 'using' statement

I'm transitioning from C# to java, so please bear with me... When reading a file in C#, you simply wrap it all in a big 'using' block, so that if you have an exception, the file will still be closed. Like so (maybe inaccurate but you get the idea): using(FileStream fs = new FileStream("c:\\myfile.txt")) { // Any exceptions while read...

What is the end of line character when reading a file in using C++ get(char& c);?

My issue is I am trying my first attempt at writing a very basic lexical analyzer for ascii text files. so far, it reads and compares to my token list properly, however I am unable to grab the final token without a space or pressing enter. I've tried using the delimiter ^Z ASCII 26 as another selection before comparing the string to my t...

AndroidManifest.xml

I came across the following two lines in AndroidMenifest.xml file of my android application: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"&gt; Why we have write "encoding" in <xml> tag, what is the purpose of it? What is the purpose of writing 2nd line ? if anybody know ...

Deleting particular text in a file using c#?

Hi Friends, My text file named test.txt contains Fixing the type manager error during checkin of the elements and supporting issues during Checkin/Checkout & merge related problems. Now i want to remove the text "supporting issues" using c#. Please anybody let me know. Thanks in advance, Naveenkumar.T ...

Insert and delete emails from a text file using PHP

Hi i am creating an under construction page where users can leave their email to be notified when the site launch i need to add those emails to a text file called list.txt my question is two parts how can i add [email protected] to the text file ? and how i can later delete certain email from a text file ? thanks for help ...

Writing file line to Django model field

I can't seem to write a line from a file to a field of a Django model. The field is described in the model as: text = models.TextField(null=True, blank=True, help_text='A status message.') However, when I attempt to create a new object I cannot fill this field using the readline function: file = open(filename, 'r') str = file.readli...

PHP Create File on Network Share

I can read files using PHP from a network share, but how can I create a file and folder on a network share? ...