file

NTFS pending delete question

In my apps (VB6 and C# 2008) on Windows 2003 twice now I have seen similar behavior regarding deletion of folders containing files. My code will build some temp folder and generate files in that folder for subsequent processing. Upon processing completion, my code will try to delete the generated temp folder. The delete operation com...

Getting the absolute path of a file within a JAR within an EAR?

I have a J2EE app deployed as an EAR file, which in turn contains a JAR file for the business layer code (including some EJBs) and a WAR file for the web layer code. The EAR file is deployed to JBoss 3.2.5, which unpacks the EAR and WAR files, but not the JAR file (this is not the problem, it's just FYI). One of the files within the JAR...

is_file or file_exists in PHP

Hi there, I need to check if a file is on HDD at a specified location ($path.$file_name). Which is the difference between is_file() and file_exists() functions and which is better/faster to use in PHP? ...

Overriding an existing file in C#

revised! I want to create a file say called test.txt. if that file already exists I want to create file called test1.txt and so on. ...

How to find files that match a wildcard string in Java?

This should be really simple. If I have a String like this: ../Test?/sample*.txt then what is a generally-accepted way to get a list of files that match this pattern? (e.g. it should match ../Test1/sample22b.txt and ../Test4/sample-spiffy.txt but not ../Test3/sample2.blah or ../Test44/sample2.txt) I've taken a look at org.apache.comm...

C#/.NET - Custom Binary File Formats - Where to Start?

I need to be able to store some data in a custom binary file format. I've never designed my own file format before. It needs to be a friendly format for traveling between the C#, Java and Ruby/Perl/Python worlds. To start with the file will consist of records. A GUID field and a JSON/YAML/XML packet field. I'm not sure what to use as de...

Is there a DCOM-exposed object that permits streaming a write-locked UTF8 file?

The Scripting.FileSystemObject TextStream object supports Windows style Unicode and 'plain text' modified by the system codepage, but does not appear to support UTF8 -- However, it can actually stream files that are locked for updates, such as an IIS logfile. ADODB.Stream supports UTF-8 (or raw binary), but will not "LoadFromFile" a fil...

How can I save a block in Visual Mode to a file in VIM?

The title is very description. Just in case, I will take an example: START BLOCK1 something END BLOCK1 START BLOCK2 something somenthing... END BLOCK2 I select the BLOCK1 in visual mode I yank it by pressing "y" How can I save the yanked BLOCK1 to some other file? ...

What is the easiest way to have a custom file implementation that only uses memory in Java

I have a code base that makes extensive use of files to represent a single data object. I have refactored the code so that the data object is now an explicit java object that mostly hides interaction with the underlying file system. However, we use a few external tools (like Weka), that read and write files. Ideally, I would like to...

why does this code lock my files?

Ive narrowed down to this method but i don't understand why its locking the file. I believe you could use something like using( something) { //do stuff here } But im not sure that would A) solve the issue or B) be the correct way if it did. any ideas? [DllImport("user32.dll", CharSet = CharSet.Auto)]private static extern Int32 Syst...

How to find encoding of a file in Unix via script(s)

Hi, I need to find the encoding of all files that are placed in a directory. Is there a way to find the encoding used? The file command is not able to do this. The encoding that is of interest to me is:ISO-8859-1. If the encoding is anythign else i want to move the file to another directory. Appreciate any assistance, Thanks, Manglu...

Load .wav file for OpenAL in Cocoa

I need to load sound files to a Cocoa-based OpenAL app. Progress: The OpenAL utility function alutLoadWAVFile has been deprecated; the alut header is no longer included in Mac OS X SDKs. According to the TechNotes, the actual code is still there for binary compatibility. However, if I attempt to add a declaration for the function, t...

Save XAML file in database.

Hi, I have a Silverlight application in witch i can create presentation slides(like in PowerPoint), and i whant to save this slides(XAML and .cs files) in database or somwhere else, where i can be able to load and to use them. Regard, Andrei. ...

Php file encryption methods. Does something simple exist?

It's seems that there isn't any pleasant way to encrypt a file in php. The built in methods of php, mcrypt, aren't very portable as most servers don't support them. Command line encryption tools are like ugly hacks. There's encryption for strings which is nice, but if we want to encrypt a file it doesn't help very much especially for ...

What is the PHP syntax for File/terminal output formatting?

I want to create a command line program using PHP. How do I design the program's I/O? I can send output as text. I am wondering about the specific output syntax. For example: In HTML i use <br/> to pass to a new line. How can I do this using terminal/file output? Is there a reference for terminal/file oriented programming in PHP? ...

ReportBuilder 7.x - Controlling Print to File at Print Time

Using ReportBuilder 7.X Question Is it possible to Control Print to File. I need to change the Length of a field at print time Example: label2 In the setup - I set its length to 800 which is the max possible this field should ever be. However, in many cases the record is less than that and i need to set it to the calculated size be...

Hosting IE 8 In WinForms and Opening a PDF

We have a form that hosts the WebBrowser control. That is the only control on the form. We pass the form the file path of a temporary PDF file and it does: WebBrowser1.Navigate(Me._PathToPdf) When the form is closing, it navigates away from the PDF file: WebBrowser1.Hide() WebBrowser1.Navigate("about:blank") Do Until WebBrowser1.Re...

How to take the input from user in console or file with ease in c#?

I am a C++ user and now trying to use c#. In c++ taking input from the user was fun (just >>) and supported all the types. So was for the files. But in c# it is too complex, as I can take only strings. Then I have to manipulate it for later use. And if I want to take multiple inputs in same line separated by whitespaces, it become more...

accessing the upload file in progress using django + nginx + apache mod_wsgi

I know that when we upload to a web application which use django, we couldn't access the upload file before it completely receive by the server. So my question, is there any way to check/access the total byte of upload file in progress? thanks ...

using Visual Studio to copy files?

Hello everyone, I want to create a Visual Studio (I am using VSTS 2008) project which simply does file copy work, in more details, I will add some files to this project and this project copy files (included in this project) to some destination location when I build the project. Any ideas how to do this in VSTS? BTW: I heard using proj...