file

File security attributes getting screwed up on file copy

I've a windows service that updates our product. It copies the product files into a temp directory, usually "C:\Windows\Temp", patches the binaries, and then uses MoveFileEx to copy the files back to the install directory on a reboot, usually "C:\Program Files\Product". The files in the install directory are inheriting their security att...

Copying file security permisions

I'm copying a file from folder A to folder B and then trying to copy the file permisions. Here are the basic steps I'm using: CopyFile(source, target) GetNamedSecurityInfo(source, GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION) Print source SD using ConvertSecurityDescriptorToStringSecurityDescriptor SetNamedSecurityInfo(target...

Is there any good documentation on the VB.Net Project file structure?

I need to start messing with a vb.net(vs2008) project file and I'd like a reference to, ideally, it's specification. Any links would be very helpful ...

What is the best web-based File Explorer?

I would like to know what you think is the best web-based File Explorer to manage files in a remote server through HTTP / Web. It would be preferable to have PHP or Flash technology, but any good suggestion would do. More generally, how would you allow someone to manage files on a remote server with HTTP being the only open outgoing po...

How can you tell whether a file is being cached in memory in linux?

Essentially my question is, does anyone know of a utility for inspecting the buffer cache in linux? ...

How to remove a shortcut file in c#

Hi, How to remove a shortcut file in c#,how to remove the program icon from the Programs folder?. Redards, Harsh Suman ...

Script to associate an extension to a program

My customer is replacing MS Office with OpenOffice in some workstations. My program export a file to Excel using the .xml extension (using open format) and opens it using the current associated program (using ShellExecute) The problem is that OpenOffice does not register the .xml extension associated with it. Manually association works...

Haskell: Inserting every line from a file into a list

I'm currently working on project with Haskell, and have found myself some trouble. I'm supposed to read and insert into a list each line in a "dictionary.txt" file, but I can't seem to do so. I've got this code: main = do let list = [] loadNums "dictionary.txt" list loadNums location list = do inh <- openFile location ReadM...

How to use PHP to delete X number of lines from the beginning of a text file.

I'm writing a PHP script and the script outputs a simple text file log of the operations it performs. How would I use PHP to delete the first several lines from this file when it reaches a certain file size? Ideally, I would like it to keep the first two lines (date/time created and blank) and start deleting from line 3 and delete X am...

How do I get a status report of all files currently being uploaded via a HTTP form on an Apache Server?

How do I get a status report of all files currently being uploaded via HTTP form based file upload on an Apache Server? ...

Managing file uploads in JSP/Servlets

Once again a very beginner-ish question, but here I go: I would like to use a servlet or similar to copy an uploaded file (from an html file select) to a permanent location. This is all I need to do with the file. I am currently going with using the Apache Commons FileUpload and IO libraries. Is there no easier or more elegant solution?...

Standard File Naming Conventions in Ruby

For a file containing the given class, SomeCoolClass, what would be the proper or standard filename? 1. somecoolclass.rb 2. some_cool_class.rb 3. some-cool-class.rb 4. SomeCoolClass.rb or some other variation? I noticed in the Ruby stdlib, versions 1, 2 and 3 are used. ...

Browse for a File from Excel VBA

How can I put up a "File Open" dialog from some VBA running in Excel? I'm using Excel 2003. ...

Gnuplot: How to plot each line in a file after some pause

Hi All, i have a 3 column datafile and i wanted to use splot to plot the same. But what i want is that gnuplot plots first row (in some colour, say red) and then pauses for say 0.3 secs and then moves on to plotting next row (in other colour, not in red, say in green), pauses for 0.3 secs and then proceeds to next row....so on n so fort...

Best method to determine changed data in C++

I need to write a tool in C++ to determine the changed bits in a file compared against another file for replication. What would be the best method of accomplishing this? I don't have a specific OS or library in mind, I'm open to suggestions. My primary goal is reducing the amount of network traffic involved in replicating. ...

How do I convert a string of the form %programfiles%\directory\tool.exe to a useable Filename in C#/.net?

I have an application which takes a string value of the form %programfiles%\directory\tool.exe from its application config file. I want to make this into a useable filename so that I can call System.Diagnostics.Process.Start(filename) and have it execute the application. I'm curently getting a System.ComponentModel.Win32Exception - ...

How to access a file with the least amount of locking

in my application (c# 3.5) there are various processes accessing a single xml file (read and write) very frequently. the code accessing the file is placed in an assembly referenced by quite a couple of other applications. for example a windows service might instanciate the MyFileReaderWriter class (locatied in the previously mentioned as...

How do I Monitor Text File Changes with C++? Difficulty: No .NET

Use case: 3rd party application wants to programatically monitor a text file being generated by another program. Text file contains data you want to analyze as it's being updated. I'm finding a lot of answers to this question wrapped around FileSystemWatcher but let's say you are writing an application for a Windows machine and can't gu...

How do I load a file into a Perl hash?

Given the following file: department=value1 location=valueA location=valueB department=value2 I use the following to load the file into a Perl hash: use File::Slurp; use Data::Dumper; my %hash = map { s/#.*//; s/^\s+//; s/\s+$//; m/(.*?)\s*=\s*(.*)/; } read_file($file); print Dumper(\%hash); The result, however, is as f...

How can I get a file's size in C?

How can I find out the size of a file? I opened with an application written in C. I would like to know the size, because I want to put the content of the loaded file into a string, which I alloc using malloc(). Just writing malloc(10000*sizeof(char)); is IMHO a bad idea. ...