file

Selecting and printing specific rows of text file

I have a very large (~8 gb) text file that has very long lines. I would like to pull out lines in selected ranges of this file and put them in another text file. In fact my question is very similar to this and this but I keep getting stuck when I try to select a range of lines instead of a single line. So far this is the only approa...

How to check that a path is an existing regular file and not a directory?

Hello: One script is used to exchange file information amongst teams. It is used as: $ share.py -p /path/to/file.txt The argument checking ensures that /path/to/file.txt exists and has the correct permissions: #[...] # ensure that file exists and is readable if not os.access(options.path, os.F_OK): raise MyError('the file does not ...

What's the least invasive way to read a locked file in C# (perhaps in unsafe mode)?

I need to read a Windows file that may be locked, but I don't want to create any kind lock that will prevent other processes from writing to the file. In addition, even if the file is locked for exclusive use, I'd like to see what's inside. Although this isn't my exact use case, consider how to read a SQL/Exchange log or database file ...

QFile open file on a shared drive

I have the following: Q_ASSERT(QFile::exists("\\.host\Shared Folders\username On My Mac\Desktop\New Deck.txt")); The file is picked from QFileDialog but when check if it exists with QFile::exists it returns FALSE; Is there any reason why QT cannot open a file on a shared drive. Btw, this path is a valid one on Windows and is generat...

Vb.net File in use

I have a VB.Net program running on vista that says a file is in use but the same program on XP does not have that error. ...

what should I do to get the new process using a new command prompt window ?

I got two console applications that the first one runs the second one: 1_first console application: #include <Tchar.h> #include <windows.h> #include <iostream> using namespace std; void main(){ PROCESS_INFORMATION obj1; memset(&obj1,0,sizeof(PROCESS_INFORMATION)); STARTUPINFOW obj2; memset(&obj2,0,sizeof(STARTUPINFOW)); obj2.cb...

Force download file with PHP giving empty file

The end goal is for the user to download a .csv file. Right now I'm just testing trying to download a simple text file: test.txt. The only thing in this file is the word "test". Here is the HTML code for files_to_download.php Test file: <a href='test.php?file=test.txt'>Test.txt</a> Code for test.php: if(!(empty($_GET["file"]))) { ...

read files in folder

hi every one. In my application there is a folder name videos. i want to raed all file only of this folder I have done almostly it does not show any folder in folder videos except .DS_Store currently i have applied if condition to hide this but i want a perfect solution can any one help:- my code is :---- <?php $dir = "../videos...

Remove file from commit

Hello, I have a list of changed files in git repository. There is one file I don't wanna commit for the current moment. Can I do: git commit -a To commit all files and then somehow remove that file from current commit? After such removing it should still be in the list of uncommited files. ...

Max file number can php upload at same time

Hello I am using the tag for uploading multiple files with php. I notice that if i choose more than 20 files php uploads only the first 20 files.Is there a way to expand this limit? ...

Using php oncli few questions ~ using XAMPP

Hi, Attempting to expand my knowledge by using PHP on the Command Line. Currently I have a default installation of XAMPP, and have set up my Environment Variable. I've been able to execute simple scripts like: <?php echo 'hello world!'; ?> Questions ~ Where do I store the scripts I am using? Currently I am doing: C:\Users\Ross>ph...

How to know what process is using a given file?

When I delete a file that's being used by some process I get the access denied error saying that the file cannot be deleted as it is currently in use. Is there a way I can find out which process exactly is using that file in WINDOWS? ...

How do I choose a good magic number for my file format?

Hi, I am designing a binary file format from scratch, and I would like to include some magic bytes at the beginning so that it can be identified easily. How do I go about choosing which bytes? I am not aware of any central registry of magic numbers, so is it just a matter of picking something fairly random that isn't already identified ...

winrar not closing correctly?

hi gurus, I have this script that runs by a windows task scheduler once a week: for /f "delims==" %%D in ('DIR D:\scripts /A /B /S') do ( "C:\Program Files\WinRAR\WinRAR.EXE" a -agyyyy-MM-dd -r "c:\backup\scripts.rar" "%%D" ) by a bat file. My question is after this bat file runs and completes, I look in my windows task manager i sti...

Logback sometimes does not write to the log file, and sometimes does not roll the log file

Sometimes when I launch my java application, logback refuses to write anything to my logfile. Sometimes it also refuses to roll the logfile at midnight (or at the first logging event after midnight), which results in logging events being lost to the void. When i look at my main log file when logbacks has failed to roll the log, it will h...

Print output into a text file in linux

Hello I am trying to get the difference between to text files. There are a lot of differences and viewing them in terminal is making it volatile since I cannot save them. I want to view and save the diff. How would I catch the output and print it to a text file?? Code I am using for getting the diff is diff -i -w -B file1.txt file2.txt ...

Processing large text files in .NET 3.5 c#

Hello, I'm tasked with reading a large text file (around 150 MB), parsing it and displaying the records in a data grid. The file is delimited by parenthesis. I'm accomplishing this by -- in a separate thread -- reading the entire file into memory, storing the information in a dataset and then binding the dataset to the data grid whi...

files no longer readable.

Hello, I have a Java project which has this file structure (shown in Eclipse): ProjectName +- Deployment Descriptor: ProjectName ¦- Java Resources:src ¦- Package1 -MyClass.java ¦- FileFolder -MyFile.txt And so far from myClass I'm able to read MyFile.txt using: try { reader = new BufferedReader(new FileReader(new Fil...

How do i get the file extension of a file in Java?

Just to be clear, I'm not looking for the MIME type. Let's say i have the input: "/path/to/file/foo.txt" I'd like a way to break this input up, specifically into ".txt" for the extension. Is there any built in ways to do this in Java? I'm still new and would like to avoid writing my own parser... :) Thanks! ...

how to send file input using jquery?

i have a form that contains 3 File inputs.i want to send it via jquery.i tried serialize function in jquery,but i realized that this function don't send file inputs! here is my form : <form id="submit_pics" action="#" > file 1 : <input name="file1" id="file1" type="file" /><br /> file 2 : <input name="file2" id="file2" type...