file

Write unicode string into file with CodeGear C++ Builder 2009

Hi everyone. I have just switched from Builder 6 to Builder 2009 and have a question. How can I write unicode string to a file? TBytes Preamble1 = TEncoding::Unicode->GetPreamble(); UnicodeString str1("string1"); int len = TEncoding::Unicode->GetByteCount(str1); FileWrite( iFile,&Preamble1[0],Preamble1.Length ); FileWrite( iFile,str...

Delete file using File.Delete and then using a Streamwriter to create the same file?

public void LoadRealmlist() { try { File.Delete(Properties.Settings.Default.WoWFolderLocation + "Data/realmlist.wtf"); StreamWriter TheWriter = new StreamWriter(Properties.Settings.Default.WoWFolderLocation + "Data/realmlist.wtf"); TheWriter.WriteLine("this is my test string"); ...

[Java] How to create tmp file name with out creating file.

I write application in Java using SWT. I would like to create unique file name. But I do not want create it on hard drive. Additional functionality: I want to create unique file name in specify folder. public String getUniqueFileName(String directory, String extension) { //create unique file name } ...

Make a File/Folder Hidden on Windows with Java

Hi, I need to make a file and/or folder hidden on both Windows and Linux. I know that appending a '.' to the front of a file/folder will make it hidden on Linux, but how do I do this on Windows? Thanks ...

VB6 Will not Create EXE file - But it use to?

I am trying to compile a VB6 project. On the File Menu it use to display MAKE PROJ1.EXE. Now it displays MAKE PROJ1. (note EXE is missing) The program runs fine in the IDE. I can start with full compile. I can even create a set up disk from the packaging and deployment wizard. I have a sucessful install, but the package will not run...

Can I disable #include in ASP.NET?

I have been unable to find anything using the google... If I write on my ASP.NET code page: <!-- #include file="file_to_include.aspx" --> the file is output to the page. How do I disable this behavior? MSDN info on #include and Server Side Include (SSI) ...

Download File Using jQuery

Hello all, How can I prompt a download for a user when they click a link. For example, instead of: <a href="uploads/file.doc">Download Here</a> I could use: <a href="#">Download Here</a> $('a').click... //Some jquery to download the file This way, Google does not index my HREF's and private files. Can this be done with jQuery...

Is there an easy way to create a C# .NET file dialog with encoding dialog box?

I'm trying to let the user select the file encoding when they load or save a file in C# and VS2008. Notepad's dialog boxes have an encoding drop down option at the bottom. There is a way to do it as described in here: http://www.codeproject.com/KB/cs/getsavefilename.aspx. However, I'm wondering if there is any easier way to do this. Wi...

Case-insensitive File.equals on case-sensitive file system

I have a file path in String form. In Java, I need to determine if that file exists on the file system (and our code needs to be cross-platform as it runs on Windows, Linux and OS X). The problem is that the case of the file path and the file itself may not match, even though they do represent the same file (presumably this is because t...

file upload progress

hi i need to implement the file upload progress in my web page i have five file upload controls in my page and i want to show the upload progress for each file upload separately. i there any way to do this. Thanks Muthuraman. ...

Avoid multipart/form-data for file transfert

I wrote a light http server in C which can handle simple requests. So I totally control the server side and its future evolution. Now on my Web Application written in Javascript/ExtJS, I need to upload a file on my server. Am I forced to use multipart/form-data to upload a file? Is it bad to directly send the file binary contained in a...

File Control not working properly in google chrome

Hi All, file control works properly in IE and firefox but in chrome the text box for the file control does not appears. can anyone suggest why is this happening? Is there any specific reason? ...

upload file with Python Mechanize

When I run the following script: from mechanize import Browser br = Browser() br.open(url) br.select_form(name="edit_form") br['file'] = 'file.txt' br.submit() I get: ValueError: value attribute is readonly And I still get the same error when I add: br.form.set_all_readonly(False) So, how can I use Python Mechanize to interact wit...

Java Post File to PHP

How can I post a file to a php using java (as a html form would do) ? ...

How to safely write to a log file from two instances of the same application?

I have an application which can only have 1 instance running at each time, however if a 2nd instance is launched it needs to be logged to a common logfile that the first could also be using. I have the check for how many instances are running and I was planning on simply logging it to the event logger initially but the application can ...

How do you load a file into a variable in ant using the &lt;loadfile&gt; task?

I'm trying the following and it doesn't seem to work. <property name="file.configs.txt" value="" /> ... <target name="..."> <loadfile property="file.configs.txt" srcFile="remoteConfig/configs.txt" /> </target> I read here that the <loadfile> task is supposed to load the contents of a file into the specified property. ...

Produce multiple files from a single file in python

Hi. I have a file like below. Sequence A.1.1 Bacteria ATGCGCGATATAGGCCT ATTATGCGCGCGCGC Sequence A.1.2 Virus ATATATGCGCCGCGCGTA ATATATATGCGCGCCGGC Sequence B.1.21 Chimpanzee ATATAGCGCGCGCGCGAT ATATATATGCGCG Sequence C.21.4 Human ATATATATGCCGCGCG ATATAATATC I want to make separate files for sequen...

SWFUpload able to load the browsing window when clicked but unable to reach the upload page

Hello I have a problem of using swfupload to upload the image to the aspx page. I can open the browsing window to select the file to upload but unable to reach to upload page. This is my javascript code that initializing the swfupload var swfu; window.onload = function() { var settings = { file_size_limit...

python shutil.copytree - ignore permissions

Python's shutil.copytree is not very flexible; what is the simplest way to add support for ignoring permissions while copying in copytree (without having to re-write its implementation)? Otherwise, copytree fails like this: (…)”[Errno 45] Operation not supported: ‘/path/foo/bar’” ...

Safe Concurrent Write to a File Shared Between a Perl and a PHP script

A Perl script (which I do not control) appends lines to the end of a text file periodically. I need my PHP script (which will run as a cron job) to read the lines from that file, process them, and then remove them from the file. But, it seems like the only way to remove a line from a file with PHP is to read the file into a variable, re...