Check if a file is open from another process
How do I check if a file is already used by another process from Powerscript ? ...
How do I check if a file is already used by another process from Powerscript ? ...
How to read and write a MS word file in VB.net or C# .net ...
Hi, I am working on an application. That application should get the resume from the users, so that I need a code to verify whether a file exists or not. I'm using ASP.NET / C#. Thanks, Suresh Kumar ...
This is perhaps similar to previous posts, but I want to be specific about the use of locking on a network, rather than locally. I want to write a file to a shared location, so it may well go on a network (certainly a Windows network, maybe Mac). I want to prevent other people from reading any part of this file whilst it it being written...
In a C# console application, is there a smart way to have console output mirrored to a text file? Currently I am just passing the same string to both Console.WriteLine and InstanceOfStreamWriter.WriteLine in a log method. ...
Is there a method in the System.IO namespace that checks the validity of a filename? Example: 'C:\foo\bar' would validate ':"~-*' would not a little trickier: 'X:\foo\bar' would validate is there is an X: drive on the system, but wouldn't otherwise. I suppose I could write such a method myself, but I'm more interested in a built-in on...
I have a directory on a Windows machine with a large number of files and folders that I need to watch and have the files mirrored/synced instantly (or as near to as possible), to a Linux machine over the local network. I've investigated: - Rsync, not realtime enough - WinSCP 'Keep directories up to date' feature, which was OK but limite...
Hi Guys, I would like when we Copy files on to the server via FTP the size of the file changes. What is the reason behind this. Does the change in the file size can make the files corrupt and the FTP process Fails ? ...
Currently our Java application uses the values held within a tab delimited *.cfg file. We need to change this application so that it now uses an XML file. What is the best/simplest library to use in order to read in values from this file? ...
Would anyone know what the Win32 equivalent of opendir is (or if it even exists) ? Obviously I could use FindFirstFile(Ex) with FindNextFile, but appending * to the path seems like such a hackish way to do it. ...
When attempting to commit file in the jsunit directory in my working-copy, I waited a really long time and got an error like: svn: OPTIONS request failed on '/svn_repo/OSB_Project/trunk/OSB/test/web/jsunit' svn: timed out waiting for server Why would the server hang at this point? Running SuSE 10.3 in a VirtualBox where I keep my Sub...
Hi folks, i need to read in a rolling log file in .NET 3.5sp1. I'm wondering what's the best way to do this? The file can get really big. An idea i had was to Open File Read file to last read line (in the first case, it was 0) Read all remaining lines Close stream and remember the last line number read. Wait a bit. Rinse/repeat. i'm...
Hi, I need to search a drive (C:, D: etc) for a partuicular file type (extension like .xml, .csv, .xls). How do I preform a recursive search to loop all directories and inner directories and return the full path of where the file(s) are? or where can I get information on this? VB.NET or C# Thanks Edit ~ I am running into some errors ...
Following code, when compiled and run with g++, prints '1' twice, whereas I expect '1' to be printed only once, since I am dumping a single structure to the file, but while reading back it seems to be reading two structures. Why? #include <iostream.h> #include <fstream.h> int main(){ struct student { int rollNo; }; ...
I have an array of filenames and need to sort that array by the extensions of the filename. Is there an easy way to do this? ...
I went to upload a new file to my web server only to get a message in return saying that my disk quota was full... I wasn't using up my allotted space but rather my allotted FILE QUANTITY. My host caps my total number of files at about 260,000. Checking through my folders I believe I found the culprit... I have a small DVD database a...
When trying to replace the content of an XML file in C#.NET with a snippet like this: string file = Path.GetTempFileName(); // pretend this is a real file string tmpFile = Path.GetTempFileName(); using (var writer = XmlWriter.Create(File.Create(tmpFile))) { writer.WriteStartElement("root"); for (int i = 0; i < 100; i++) { ...
I'm getting the folowing error for below code, "1506-221 (S) Initializer must be a valid constant expression" FILE *fp[] = {stdout, dump_f}; is this acceptable? what is the proper way to achive this? ...
I was just reviewing some old code and found the following (inside foo.asp): Const ASP_FILENAME = "foo.asp" ' TODO: Update this to the name of this file (if changed) The variable is only used for logging errors. (ie. "Error in foo.asp - Could not create xxxxx object.") Is there any way to avoid this? Thanks! ...
I want to be able to run a regular expression on an entire file, but I'd like to be able to not have to read the whole file into memory at once as I may be working with rather large files in the future. Is there a way to do this? Thanks! Clarification: I cannot read line-by-line because it can span multiple lines. ...