I have a project with many many files (100k+) that I am processing. I would like to save some CPU time by disabling directory indexing, but I need to do it programmatically because this application will be used by multiple people with varying technological skillsets.
I wasn't sure where to start with this, so hopefully someone here can point me in the right direction!
I figured this out finally.
File.SetAttributes(Core.Main.pictureBox1.ImageLocation, FileAttributes.NotContentIndexed);
http://msdn.microsoft.com/en-us/library/system.io.fileattributes(v=vs.110).aspx
Related
My dev team is having an issue when trying to add certain files to the ignore.conf file for PlasticSCM. When we try to add the FMODStudioCache.asset and fmod_editor.log, among other FMOD related files, to this config file, they just continue to appear in Unity when receiving pushes and readying a push locally.
It has become very annoying to deal with because it doesn't seem to work as it is intended to. See below the lines we have tried to prevent it from showing up.
**/Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset
**/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset
fmod_editor.log
# Ignore the Cache folder since it is updated locally.
/[Aa]ssets/Plugins/FMOD/Cache/*
[Aa]ssets/Plugins/FMOD/Cache/*
Assets/Plugins/FMOD/Cache/*
Image link of Unity PlasticSCM with
Sorry, I don't have enough posts yet so it makes me use a link above!
Has anyone found a solution to this? We have tried to even add the files to the hidden config file too and that doesn't work either... Thanks in advance !
Edit: Spelling error in question.
I am looking for a few pointers to reaching am adequate solution to a problem/feature I need to implement/rectify in my asp.net mvc application.
My application is a LAN only interface that is run over a webserver. In this application there is a page that displays a bunch of files/folders.
I need to be able to store a set of attributes\properties about these files, and those props\attrs need to be independent of their location on the fileserver. This is my main issue, as I could easily link them to the db with the path as the primary key, but alas then as soon as the file moves their link to the db would be lost.
The types of files that need to be displayed unfortunately could be anything. .txt, .exe, media etc etc. So that provides a limiting option also from using something like the tagsharp lib.
One approach i was considering was simply storing a key somehow in the file itself, or with an ADS ( i have no experience in doing this, but am presently trying to research its potentiality).
Does anybody have any experience with this issue, and can recommend a simple approach. I am hoping i do not need to implement an ADS approach as what ive been reading so far is a little bit over my head and im not sure C# will handle the streams adequately for my needs.
Opinion based. Proposal anyway: what about an additional file which is found by a naming convention?
MyDocument.doxc
MyDomument.docx.properties
MyMovie.mp4
MyMovie.mp4.properties
When moving / renaming files, make sure you move / rename the properties file the same.
First of all thanks for taking a moment to reply.
I had considered the possibility of using a separate file. The problem is that the users of the filesystem ( which may or may not include users of the lan application ) need to be able to move/copy files independent of db application.
Therefore if a user moves a file in windows explorer, I need it to automatically move those additional properties with it. Unfortunately I cant rely on users to move those additional files on their own volition, and I cant ask users to only use the application to move files ( if i were to generate code for the program to do this ).
I am looking for a way to pragmatically remove IIS6 applications (via vb or c#). Through IIS Manager, this would be as simple as navigating to the application I want to disable, right click for properties and clicking remove. This would leave the file system intact and remove the folder from being an application. I've seen lots of information on how to remove an entire virtual directory and delete folders, but nothing that I can find explains how to simply disable the application.
Just to add one other complication, these applications are often nested several folders deep rather than within the root website itself. However, I do know their exact physical path.
I've spend most of my day trying to figure this one out.
The best I've been able to do with this problem is to stop and start an entire web site. If you can move your application into its own web site within IIS, this will do just what you want. Read more here:
http://adamprescott.net/2011/09/26/programmatically-start-stop-iis-web-sites-in-c/
It also might be worth considering simply renaming the root directory to something like "Foo.disabled." I know that's not quite what you're looking for, but it'd give you a simple, straightforward solution. Since you know the exact physical path, it should be easy to determine the current state and provide toggle capability based on the folder name. I've never gone this route; I'm just thinking out loud.
I am working on an application that keeps track and uses files stored on the file system. Users are allowed to open, create, delete and move files in the file system. Meanwhile my application is not constantly running so I can't keep track of all changes real-time. Afterwards my application has to find out what file is whom (i.c. as identified in my application).
The most preferred solution for the users is that the application solves every change itself. Each user-interaction is less preferred.
One of my ideas was to use an attribute of a file and assign a key-value to it so when it has been identified once, it can always been recognized afterwards. But I don't know if there is such an attribute. This article didn't give much hope: There is in Windows file systems a pre computed hash for each file?.
Does somebody know if there is such an attribute I can use? And how can I used it in C#?
Is there anyone who is running up against this problem? And how did you solve it?
I'd like to hear good suggestions.
regards, Jaap
If your files don't leave NTFS, this is easily achievable by alternative data streams, where you can store your data along with files. This is more-or-less good article about ADS: http://www.flexhex.com/docs/articles/alternate-streams.phtml
There is another suitable method - it's very efficient, but also very complicated to use, it requires quite good knowledge about NTFS internals - USN Change Journal; see http://msdn.microsoft.com/en-us/library/windows/desktop/aa363798.aspx. With USN Change Journal, you can "get" very efficiently all files that were changed (even all change events) within specified time period.
Nevertheless, if your files leave NTFS realm, e.g. if it's copied to FAT32, contents of ADS is lost.
Relying on a File attribute is "dangerous" in that some user could alter the attribute while your program isn't running. This could lead you to believe that a certain file is (or isn't) tracked by the program while it really isn't.
I would suggest to keep track of the files in a database, XML, or some other file. When your application starts you read the file/db and check for new/deleted/editted files.
You could store a Hash of the files to find out if a file has been moved/editted. Keeping track of files that are moved AND editted is going to be pretty difficult. (I have no clue how you could achieve it)
PS: Have you considered making your application a Windows service? Having the file-management running in the background no matter if the GUI part of your application is running or not?
I'm not sure if the question's title makes sense, and I'm sorry if it doesn't; I didn't really know what to title it.. Anyway, is there a way to make your program track the viewing of a folder?
What I'm trying to achieve: Windows 7 Home Premium doesn't allow encryption. So, I made a folder inside my user directory, and set it to hidden. Although, you can easily find it by changing windows settings.. So, is there a way to make a program pull up a window if the user tries to access that certain folder?
I don't think you can detect the "opening" of a folder.
Instead, you may want to set a FileSystemWatcher to detect any file access to the files in that particular folder.
Hope this helps.
First of all, I have to wonder why you're not just setting an ACL on the directory to prevent access.
However, it sounds like you want to find when somebody is accessing a particular directory. To do this, you enable filesystem auditing, then set the audit ACL to generate audit entries for "List folder". This will cause entries to be generated in the Security Event Log whenever the directory is viewed.
Now you just have to write a program that watches the Security event log looking for entries indicating that somebody has listed the directory in question and take action as necessary.
Well, there is an article on code project describing how you can hook into windows system calls: http://www.codeproject.com/KB/system/hooksys.aspx - it's not simple though (and also not C#) and has the potential to screw with your system but if it might be a fun project to work on.
A simpler option would be: Use a 3rd party desktop encryption tool - not much programming involved here but it might do the job better than anything else.