file

Is python's shutil.move() atomic on linux ?

Hi, I am wondering whether python's shutil.move is atomic on linux ? Is the behavior different if the source and destination files are on two different partitions or is it same as when they are present on the same partition ? I am more concerned to know whether the shutil.move is atomic if the source and destination files are on the sa...

How to redirect "/" to "/home.html" only if the file "/index.html" does not physically exists?

Hello everybody, I found a way to redirect (not load, but change the URL) "/" to "/home.html". And now I want to add a RewriteCond to avoid the redirection if the file "/index.html" exists. I tried (without the comments), but it didn't worked : # We check that we comes from "domain.tld/" RewriteCond %{REQUEST_URI} =/ # We check that ...

how to read file line by line in shell script and store each line in a variable.

hi all, i am new in unix. i have to write a shell script which read a file line by line and store it in a separate variable. my text file contents multiple source path and one destination path. something like this:: source_path=abc/xyz source_path=pqr/abc desination_path=abcd/mlk number of source path can vary. I dont have much hands ...

How to omit file path compression?

I have a process that injects environment variables while the process is running and all that works fine. However, when I expand one of the environment variables (Environment.ExpandEnvironmentVariables in C#) sometimes I get a compressed value of the file path: d:\progra~1\mifbef~1... instead of d:\Program Files\... Functionally ...

Where does a resource file go when you compile .NET website?

I have local resource files for my web application. I want to know the location of the .resource file once the compiler creates it from the resx file. The reason i wish to know this is so I can compile on the local server and copy the .resource files to live and avoid a complete redeploy for simple text change. Thanks, Shawn ...

How to copy a file from one windows machine to other windows machine?

How to copy a file from one Windows machine to other Windows machine? so that i can write a batch script can run that from Hudson machine. My requirement is , I like to deploy war in tomcat server located remotely in another windows machine through Hudson (war will be generated in this machine) which is located in another windows machin...

Why doesn't my Perl blessed filehandle doesn't return true with `can('print')`'?

For some reason, I can't get filehandles working with Expect.pm's log_file method. I originally got help on How can I pass a filehandle to Perl Expect's log_file function?, where it was suggested that I use an IO::Handle filehandle to pass to the method. This seems to be a different issue, so I thought I'd start a new question. This i...

Ruby-Rails serve ftp file direct to client

Hello! I am new to ruby and to rails, so excuse my question... . What i want to know is, how to take a file from a ftp server with ruby without saving the file on my rails application harddrive (streaming the filedata direct to the client). I am working with the ruby Net/FTP class. With the method "retrbinary" from the Net/FTP class i ...

C++ read numbers from file and store in vectors

Hi everyone, I am having trouble "undoing" this method, that dumps essentially a matrix of numbers of variable size into a text file: void vectorToFile(char *name, vector<vector<double>>* a){ FILE* fp = fopen(name, "w"); for(int i=0;i<a->size();i++){ for(int j=0;j<a->at(i).size();j++){ fprintf(fp, "%f ", a->a...

How to read coordinates from file in iPhone

I have a text file that contains a list of coords to construct a path: 123,44 124,67 178,85 This file is included as part of the bundle. The question is how can I read the points from this file. In C++ there's fscanf, what about Cocoa? ...

data loss when file is transfer from server to client using stream in c#

server side stream.BeginWrite(clientData, 0, clientData.Length, new AsyncCallback(CompleteWrite), stream); client side int tot = s.Read(clientData, 0, clientData.Length); I have used TCPClient,TCPlistener classes clientData is a byte array.Size of ClientData is 2682 in server side.I have used NetworkStream class to write d...

How can i access a file (say .xml) from a native code,invoked from an android activity class, where do i need to place that XML file?

Hi, I am trying out an example of OpenCV from http://github.com/billmccord/OpenCV-Android and am stuck at the point where it is mentioned "Before attempting to run the VideoEmulator application, you must first copy this XML file into the emulator in the following location: /data/data/org.siprop.opencv/files/haarcascade_frontalface_alt.xm...

Android Write files

I write file to sdcard using BufferedWriter.After that I want to overwrite header of file,but other data must be without changes( In the header I must add size of file). So I think I must change position where I need write. How can I do that?What function should I use? ...

is it possible to download a file in my iphone throuh email

I am working on an application in which i write to an xml file and then send it through email and at the reciever end the receiver recives it in his/her inbox and download the file to the iphone and then open the same app on his phone and browse to this file and by clicking sync button the progra should parse the tags in the xml file. Ev...

D file I/O functions

I'm just learning D. Looks like a great language, but I can't find any info about the file I/O functions. I may be being dim (I'm good at that!), so could somebody point me in the right direction, please? Thanks ...

How can I present live audio data (updating buffer) as an audio file in C

Hi I am recieving live audio as floating points in an updating array. I want this live data to present as a file that can b read by vlc media player. Can someone guide me how can I do that in C language? /mudassar ...

ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error

RE: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error Two Issues, apparently unrelated. I have subfolders like this /ApplicantDocuments/20 and /ApplicantDocuments/21 (where 20 and 21 are my subfolders and ApplicantDocuments is my library. The below function is erroring with file not ...

C# Wav File Playing freezes GUI

Problem: The wav files plays, but GUI does not respond at all. The lbl_PhonoString.Text is not updated every loop. User cannot pause or cancel until all the files are played completely. I know I have to use a seaparate thread to play the Wav file. I am not at all familiar with threading. Can someone suggest what I should do here? My Co...

text file input issues in C++

I am having to read a text file; however, one certain text file is giving me issues. Not only is the text file huge (an entire ebook), but there are also several accented letters. I am reading in the words one letter at a time stopping on appropriate punctuation or spaces. I do this by testing appropriate ASCII for letters and punctua...

common place to store files on mac and windows.

hi. am writing a java code that needs to save a file. the below code is for mac. ImageIO.write(movie_image, "jpg",new File("/Users/sathyap/Desktop/movieimages/"+fileName+".jpg")); is there a way i can give the directory structure "/Users/sathyap/Desktop/movieimages/" hardcoded that works for both mac and windows. ...