file

Python Windows File Copy with Wildcard Support

I've been doing this all the time: result = subprocess.call(['copy', '123*.xml', 'out_folder\\.', '/y']) if result == 0: do_something() else: do_something_else() Until today I started to look into pywin32 modules, then I saw functions like win32file.CopyFiles(), but then I found it may not support copying files to a directo...

How to search for multiple strings in a file

I want to search for the occurrence of string1 OR string2 OR string3, etc. in a file, and print only those lines (to stdout or a file, either one). How can I easily do this in bash? ...

loading files through one file to hide locations

Hello all. Im currently doing a project in which my client does not want to location ( ie folder names and locations ) to be displayed. so I have done something like this: <link href="./?0000=css&0001=0001&0002=css" rel="stylesheet" type="text/css" /> <link href="./?0000=css&0001=0002&0002=css" rel="stylesheet" type="text/css" /> <scri...

Java File URI error ?

I need to get a file object online, and I know the file is located at : http://nmjava.com/Dir_App_IDs/Dir_GlassPaneDemo/GlassPaneDemo_2010_04_06_15_00_SNGRGLJAMX If I paste it into my browser's url, I'll be able to download this file, now I'm trying to get it with Java, my code looks like this : String File_Url="http://nmjava.com/Dir_A...

Why does this code read all ' ' for the anything after the 4th character?

#define fileSize 100000 int main(int argc, char *argv[]){ char *name=argv[1]; char ret[fileSize]; FILE *fl = fopen(name, "rb"); fseek(fl, 0, SEEK_END); long len = fileSize; fseek(fl, 0, SEEK_SET); //fread(ret, 1, len, fl); int i; *(ret+fileSize) = '\0'; ...

Flex 3 file download - Without URLRequest

Hey guys, My Flex client app has got some data from the back end (RemoteObjects, BlazeDS, Spring). Client has got all the data it needs, it now needs to put some information in a CSV format and make it available for download. Using Flex 3 for this. Any ideas? Thanks, Sri ...

Resource files for Company-wise Label Values - Implicit calling of Global Resources

We have several companies using one web application. Companies may decide to display different values in Labels. e.g. CompanyA -> ZipCodeCaption = "Zip Code" CompanyB -> ZipCodeCaption = "Pin Code" CompanyA -> USDSymbolCaption = "USD" CompanyB -> USDSymbolCaption = "$" Currently, we have different settings saved for different compa...

C# 4.0: System.Diagnostics.Process

Hi I would like to know if there's an existing implementation of checking if application(Acrobat Reader) exist in your local machine before I start to open it. for example I want to open a pdf file and i dont have an acrobat reader, so how will I check If I have an installed program for me to open the file?. System.Diagnostics.Process...

How do I create an empty file in emacs?

How can I create an empty file from emacs, ideally from within a dired buffer? For example, I've just opened a Python module in dired mode, created a new directory, opened that in dired, and now need to add an empty __init__.py file in the directory. If I use C-x C-f __init__.py RET C-x C-s then emacs doesn't create the file because no...

Why is calling close() after fopen() not closing?

I ran across the following code in one of our in-house dlls and I am trying to understand the behavior it was showing: long GetFD(long* fd, const char* fileName, const char* mode) { string fileMode; if (strlen(mode) == 0 || tolower(mode[0]) == 'w' || tolower(mode[0]) == 'o') fileMode = string("w"); else if (tolowe...

PHP File Upload second file does not upload, first file does without error

So I have a script I have been using and it generally works well with multiple files... When I upload a very large file in a multiple file upload, only the first file is uploaded. I am not seeing an errors as to why. I figure this is related to a timeout setting but can not figure it out - Any ideas? I have foloowing set in my htacc...

Accessing the text file that is stored on BLOB of Windows Azure

I am working on Windows Azure. I followed some tutorial about how to store text file on to the blob of windows azure. I am successful in uploading the data. Now, I wanted to access the file. I mean, I have to read the content of the file and display it.... Can anyone tell me, How to do that... Thanks, in advance... ...

Get username of opened file

Is there a way to learn the username of the user that has a file open? I am developing a program that will be a desktop client for many users. The application will open some files and I'd like to allow many users to open the files at the same time, but only allow the first user to have write privileges. What I want is to be able to te...

Opening A Specific File With A Batch File?

I'm would like to know how I can open a specific file using a specific program with a batch file. So far, my batch file can open the program, but I'm not sure how to open a file with that program. @echo off start wgnuplot.exe ...

_fsopen for C in Borland c++ builderX 2003 and MVS2008

Hi, with MVS2008, this line works fine: _fsopen(file_name, "wb+", _SH_DENYRW); Borland C++builderX from 2003 complains about the argument _SH_DENYRW. I changed to _fsopen(file_name, "wb+", SH_DENYRW); removing the underscore and Borland compiles well now. Is it good what I'm doing? I saw this modification somewhere on the web. T...

Eclipse / Aptana File Sync Solutions

Our development team uses Eclipse + Aptana to do their web development work. Currently, most of them are mapping their Eclipse projects directly to the web server. I'd rather them create a local project and use that to sync to the web server project directory they are working on. The issue is that there aren't any good solutions whi...

Write to a binary file?

Here is data structure w/ variables: struct Part_record { char id_no[3]; int qoh; string desc; double price: }; --- (Using "cin" to input data) --- Part_record null_part = {" ", 0," ",0.0}; --- --- file.seekg( -(long)sizeof(Part_record), ios::cur); file.write( ( char *)&part, sizeof(Part_record) ...

PHP readfile for force downloading files and images

I want to send files through php using readfile() What i've noticed is that readfile forces a download, but what if i want to show an image in the browser and not force a download? Would readfile still force download even if the file is an image? If it does, is there a solution so i can use tags with it when the file is an image? Th...

Building an AIR application with ANT

I keep getting "Java Heap Space" error. What is the JVM Memory requirements to build AIR apps with ant? ...

How to search for duplicate values in a huge text file having around Half Million records

I have an input txt file which has data in the form of records (each row is a record and represents more or less like a DB table) and I need to find for duplicate values. For example: Rec1: ACCOUNT_NBR_1*NAME_1*VALUE_1 Rec2: ACCOUNT_NBR_2*NAME_2*VALUE_2 Rec3: ACCOUNT_NBR_1*NAME_3*VALUE_3 In the above set, the Rec1 and Rec2 are conside...