files

Grep : get all file that doesn't have a line that matches

This may be a duplicate as I believe I already saw something like that but can't find it anymore so I'm asking : I have a lots of files with multiple lines, and in most case, one of the line contain a certain patern. I would like to have every file that do not have a line with this patern. EDIT : Just need to use the "-L" grep option. ...

How to read multiple text files and save them into one text file?

Hello, In my case I have five huge text files,which I have to embedd into one text file. I tried with StreamReader(),but I don't know how to make it Read one more file,do I have to assign another variable? Showing an example will be appreciated greatfully. ...

Object reference not set to an instance of an object?

I wrote these lines but i have NullReferenceException. please help me how to fix it! string FullPath = TempPath + FileName; System.Drawing.Image Adimg = null; Adimg = System.Drawing.Image.FromFile(MapPath(FullPath)); I put these lines in a Public bool method and TempPath is class property and FileName is input for the method. excepti...

How can I randomize the lines in a file using a standard tools on Redhat Linux

How can I randomize the lines in a file using a standard tools on Redhat Linux? I don't have the "shuf" command, so I am looking for something like a perl or awk one liner that accomplishes the same task. ...

What is "wua" mode when opening a file in python?

I have recently been going through some of our windows python 2.4 code and come across this: self.logfile = open(self.logfile_name, "wua") I know what w, u and a do on their own, but what happens when you combine them? ...

Python - change file creating date

Hello, can I change creating date of some file using python in Linux? ...

Prompting a user for the filename or directory

I'm prompting the user for a filename, if they enter a valid filename the first time, it works. However, if its invalid the first time, every other check fails. How would I fix this? Also, let's say they just specify a directory, how would I get the names of all the text files and how many there are? int main() { ifstream inFile; ...

How to assign permissions for Copy/Paste on windows

Well, as everyone knows there is no way you can assign permissions for Copy/Paste of files on windows platform. I need to control the copy process from a central file server, in a way that helps me know: which user performed the copy Which files were copied where did he pasted them Total size of data copied Time of copy operation If u...

Is there an open-source solution to XA-transactional file access in Java?

Hi, Is it possible to make XA-transactional access to the file system in Java? I want to manipulate files within the boundaries of a transaction and my transaction must participate in a distributed transaction via JTA (so I guess the file system needs to be accesses as a XAResource). I don't need support for fine-grained read/write fil...

Java - How to find out whether a File name is valid?

In my Java application I am renaming files to a file name provided in a String parameter. There is a method boolean OKtoRename(String oldName, String newName) which basically checks whether the newName isn't already taken by some other file, as I wouldn't want to bury existing ones. It now occurred to me that perhaps the newName Stri...

PHP Outputting File Attachments with Headers

After reading a few posts here I formulated this function which is sort of a mishmash of a bunch of others: function outputFile( $filePath, $fileName, $mimeType = '' ) { // Setup $mimeTypes = array( 'pdf' => 'application/pdf', 'txt' => 'text/plain', 'html' => 'text/html', 'exe' => 'application/oct...

How do I make data uploaded by PHP safe during transmission?

I'm allowing authenticated users to upload image files with my PHP application. Assume I've built in the necessary security to make sure the file itself is valid, is there a possibility of the http transmitted file to be intercepted in some way? If so, how can I protect the transmission of the file? Would HTTPS be the way to go? Also, ...

How can I detect if a file is binary (non-text) in python?

How can I tell if a file is binary (non-text) in python? I am searching through a large set of files in python, and keep getting matches in binary files. This makes the output look incredibly messy. I know I could use grep -I, but I am doing more with the data than what grep allows for. In the past I would have just searched for charac...

Read Unicode files C++

Hi all, I have a simple question to ask. I have a UTF 16 text file to read wich starts with FFFE. What are the C++ tools to deal with this kind of file? I just want to read it, filter some lines, and display the result. It looks simple, but I just have experience in work with plain ascci files and I'm in the hurry. I'm using VS C++, b...

How do I add a cs file to an existing C# project?

A while back I wrote a little program in Microsoft Visual C# 2008 Express Edition. In it included a file called "ProblemReport.cs" with it's own form and ProblemReport class. I'm writing a new program and want to reuse this code. (still working in MS Vis C# 2008 express) In my new program, in the C# Solution Explorer, I right clicked...

A problem with downloading a file with Python

Hello, I try to automatically download a file by clicking on a link on the webpage. After clicking on the link, I get the 'File Download' Window dialog with 'Open', 'Save' and 'Cancel' buttons. I would like to click the Save button. I use watsup library in the following way: from watsup.winGuiAuto import * optDialog = findTopWindow(w...

how to Zip files in vb.net 2005

hai how to zip files(Any files or folder ) in vb.net 2005.please give some ideas thank you by somu ...

file size c is different than the size data string's size

I have a file I'm writing to and then changing the size of it to the size of text written to it something like: FILE * file... I get all the data from the file and change the file's size to the data's size but it differs. The string's size is smaller then the filelength and it cuts it and loses data. What might be the problem? while(...

Copy file(s) containing string to a location oneliner - is there a better way with cmd.exe ?

This for /f "tokens=*" %i in ('dir *sonic.exe /s /b') do copy /y "%i" D:\temp\utils\ The question is there a better or shorter way to do it ? p.s. I know that "tokens=*" could be omitted if the file path does not have spaces .. Update: I found a shorter ways of finding ( not copying ) from my old cheat sheets: ::START - RUN - cmd...

How the shared files (linked files) in VSS can be migrated to a Subversion repository in Debian ?

How the shared files (linked files) in VSS can be migrated to a Subversion repository in Debian ? Please help. ...