file

How to create required file name in unix using shell script

I am reading one property file which contains some file paths using shell script. Now depending on this file path I want to create name of zip file. Something like this...My property file contents:: path=tmp/inputs/logs/abc path=tmp/backup/inte/xyz destpath=abc/xyz Now I am able to create file name as abc.zip and xyz.zip as: paths=`g...

Android Development: How To Automatically Add Linebreaks When Using setText()?

Hello, In my app is the ability to read a file. This works perfectly, but there's a problem. No line breaks or whatever they are called get added when I append the file's contents to my big EditText, so this: function hmm(){ echo 'Hello, PHP!'; } would turn into this: function hmm(){ echo 'Hello, PHP!'; } How can I stop this and m...

Comparing filehandle with glob returned by IO::Select::can_read()

Hello, I am trying to manage three filehandles via IO::Select in perl. I have 1 input handle, 1 input/output handle, and 1 output handle. Im having a little trouble determining which filehandle is which when processing Select's return arrays of can_read() and can_write(); Example below Any advice on how to actually compare these two f...

PHP file permissions

How can I set permissions of a file to let a PHP program read and write but not be read by the public. When I set read permissions it denies PHP to the files. ...

Alternate ways of saving a list into a file in Python

Hi, I am trying to a save a list into a file in a way that when I load and read the file again I get my lists as they are. In other words,the datatype doesn't change while saving and loading. Because right now, I use "write" to save my list into a file, and when I try to load it back into memory I get strings rather than real lists. is t...

How to accelerate reads from batches of files

I read many files from my system. I want to read them faster, maybe like this: results=[] for file in open("filenames.txt").readlines(): results.append(open(file,"r").read()) I don't want to use threading. Any advice is appreciated. the reason why i don't want to use threads is because it will make my code unreadable,i want to fi...

Matlab's 'save' function - how to name the variable inside the .mat file same as file name?

I want to save the result of the q_yearly for each case_no in corresponding string of the q_cases_yearly as a .mat file. With my statement of save(q_cases_yearly{case_no},'q_yearly') even though the names of files are coming as the corresponding string of q_cases_yearly, however all those .mat files contain variable with the same name of...

Upload image into database using php

Hi, i am trying to upload image into database using php, i got an error message saying Undefined index: horse_image here is the form code: <form method="post" enctype="multipart/form-data"action="newhorse.php" OnSubmit="return VerifyDataEntry(this)"> <p>Please type the horse details below <p>Horse Id: <input type="text" name="horse_...

How to duplicate a PHP file using PHP.

How can I duplicate a php file that I already created and place it into a different directory when a user pushes the submit button ...

What's wrong with this code

public static void write () throws IOException, WriteException { WorkbookSettings settings = new WorkbookSettings(); File seurantaraportti = new File("ta.xls"); WritableWorkbook seurw = Workbook.createWorkbook(ta,settings); seurw.createSheet("ta", 0); WritableSheet ws = seurw.getSheet(0); addNumber(ws,0,0,100.0); seu...

C# file upload: no groups from reg ex???

Hi all, this code was working fine till this morning, can anyone spot my mistake? probably really silly but it has me stumped! i use a form to submit a file (field name 'fileUpEx'), and then i wrote a class to upload it (like i said, it's been working for ages).... (if i write 'filepath' to the page it is 'Test copy.pdf') My class retur...

How do I open a file from multiple processes?

Hi, Hopefully more of a "What am I doing wrong?" than "How do I?" but there you go... Basically, I'm trying to get a program to behave in the following way: First instance of the program opens up on PC1, opens a file for Read/Write access and then acts as the master program, doing a bunch of work on some other files I don't want a wh...

convert textfile to pdf iphone or ipad ?

how to convert a text file to pdf , i achived it by 2 qurtz frame work , but it is time killing, is their any way to convert text files to pdf in ipad. thanks Kumar ...

Check if a file is accessable on a shared network drive

Hi, I have a program that does different things my questions is related to access files in a network mapped drive or a shared folder the program can run a file msi/exe from the network (network mapped drive or a shared folder) the program can copy file from the network (network mapped drive or a shared folder) how I can check if the f...

file permissions are changed through joomla

Hi, I have a default installation of joomla under ubuntu 10.04. I have also changed the permissions of index.php of template(apache user with read write permissions), so that I can change the index.php from administrator screen. Everything works fine till here. But now when I change the file from admin screen and save the file, its cha...

Searching for particular word in files.

Hi All, We have a requirement to replace word 'ABC'(dummied) with 'XYZ'(dummied) in all the files. We have hundreds of aspx/ascx/cs/xml/xsl files which might contain the word. The requirement is Do not replace word if it is part of NameSpace(eg ABC.A1.A2 should not be replaced) or variable names(var abc = "") or tags (abc:control)....

Using pyinotify to watch for file creation, but waiting for it to be completely written to disk

I'm using pyinotify to watch a folder for when files are created in it. And when certain files are created I want to move them. The problem is that as soon as the file is created (obviously), my program tries to move it, even before it's completely written to disk. Is there a way to make pyinotify wait until a file is completely written...

Something wrong with my code? Multiple Upload PHP file

Here is the code i made, im expecting it to work but somewhere there must be an error. I can't figure out myself, Please help. <?php if(isset($_POST['submit'])){ $max_size = 500000; $image_upload_path = "images/products/"; $allowed_image_extension = array('jpg','jpeg','png','gif'); for($i=0;$i<2;$i++) { ...

how quick read 25k small txt file content with python

i download many html store in os,now get their content ,and extract data what i need to persistence to mysql, i use the traditional load file one by one ,it's not efficant cost nealy 8 mins. any advice is welcome g_fields=[ 'name', 'price', 'productid', 'site', 'link', 'smallImage', 'bigImage', 'description', 'createdOn', 'mo...

How to track a completed file download in ASP.NET

Hi everybody, I have this ASP.NET web site that allows users to download program installation packages (just normal files). I want to be able to track when a download is completed (i.e. the file has been fully downloaded to the user's computer) and then invoke a Google Analytics script that reports a completed download as a 'Goal' (obvi...