directory

Is there a way to detect changes in a folder using php on both windows and linux?

*爱你&永不变心* 提交于 2020-01-01 12:15:11
问题 I'm looking for a solution to detect changes in folder(s) using php . The application may run on both platforms( linux and windows ). I may use different methods for each platform as long as results are the same. What I desire is : If a file/folder is added to a directory, I want my app to detect this new file and read its attributes ( size,filetime etc) If a existing file/folder is saved/contents changed/deleted, I need to detect this file is changed It would be better if I can monitor a

Access Virtual Directory folder through code behind Asp.net

北城余情 提交于 2020-01-01 12:10:03
问题 I am trying to access a Virtual Directory folder from Code-behind. ASP.Net Website Name : SuperImages Physical folder : C:\images Virtual Directory folder : allimages (In same level as App_Data, Scripts, Properties folders) I am trying to access and do a count of the number of items in this folder, then display them on a webpage. How should I do this? Thanks in advance! ======================================================================= Update : From the posts below, it seems that Server

How do I Get Folder Size in C#? [duplicate]

走远了吗. 提交于 2020-01-01 11:23:51
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How do I get a directory size (files in the directory) in C#? In vbscript, it's incredibly simple to get the folder size in GB or MB: Set oFSO = CreateObject("Scripting.FileSystemObject") Dim fSize = CInt((oFSO.GetFolder(path).Size / 1024) / 1024) WScript.Echo fSize In C#, with all my searches, all I can come up with are long, convoluted, recursive searches for every file size in all subfolders, then add them

Creating a file in a non-existing folder using OpenCV in Python

风格不统一 提交于 2020-01-01 09:35:07
问题 i am trying to create an image file using opencv in python. when i am creating it in same folder file is created face_file_name = "te.jpg" cv2.imwrite(face_file_name, image) but when i am trying to create it in another folder like face_file_name = "test\te.jpg" cv2.imwrite(face_file_name, image) file is not created. can someone explain the reasons?? i even tried giving absolute path. i am using python2.7 in windows. 回答1: cv2.imwrite() will not write an image in another directory if the

Creating a file in a non-existing folder using OpenCV in Python

亡梦爱人 提交于 2020-01-01 09:35:02
问题 i am trying to create an image file using opencv in python. when i am creating it in same folder file is created face_file_name = "te.jpg" cv2.imwrite(face_file_name, image) but when i am trying to create it in another folder like face_file_name = "test\te.jpg" cv2.imwrite(face_file_name, image) file is not created. can someone explain the reasons?? i even tried giving absolute path. i am using python2.7 in windows. 回答1: cv2.imwrite() will not write an image in another directory if the

Callable与 Future

帅比萌擦擦* 提交于 2020-01-01 09:33:19
Callable 与 Future 两功能是Java在后续版本中为了适应多并法才加入的,Callable是类似于Runnable的接口,实现Callable接口的类和实现Runnable的类都是可被其他线程执行的任务。 Callable的接口定义如下; public interface Callable<V> { V call() throws Exception; } Callable和Runnable的区别如下: I Callable定义的方法是call,而Runnable定义的方法是run。 II Callable的call方法可以有返回值,而Runnable的run方法不能有返回值。 III Callable的call方法可抛出异常,而Runnable的run方法不能抛出异常。 Future 介绍 Future表示异步计算的结果,它提供了检查计算是否完成的方法,以等待计算的完成,并检索计算的结果。Future的cancel方法可以取消任务的执行,它有一布尔参数,参数为 true 表示立即中断任务的执行,参数为 false 表示允许正在运行的任务运行完成。Future的 get 方法等待计算完成,获取计算结果 例子: 1 import java.io.*; 2 import java.util.*; 3 import java.util.concurrent.*; 4 5 6

Turn Off the Folder/Namespace Convention

假装没事ソ 提交于 2020-01-01 09:09:15
问题 I see people talking about the annoyance of Visual Studio automatically creating a namespace to correspond with project folders. Is there a way to turn this off in VS 2010, without resorting to modifying class templates? 回答1: If you use Resharper, there is an attribute on the folder 'Namespace Provider'. Even if you set it to false, Visual Studio will still add folder name as a namespace. However, Resharper fixes it with one click on the namespace. 回答2: Use Resharper. Turn off the "Namespace

Django upload file into specific directory that depends on the POST URI

こ雲淡風輕ζ 提交于 2020-01-01 08:48:48
问题 I'd like to store uploaded files into a specific directory that depends on the URI of the POST request. Perhaps, I'd also like to rename the file to something fixed (the name of the file input for example) so I have an easy way to grep the file system, etc. and also to avoid possible security problems. What's the preferred way to do this in Django? Edit: I should clarify that I'd be interested in possibly doing this as a file upload handler to avoid writing a large file twice to the file

Xcode files and folders clean structure and organization

醉酒当歌 提交于 2020-01-01 08:17:31
问题 After four years in development with Xcode I started to ask myself (well, yes, I know, a little too late but when you are deep in coding you don't see other things) what kind of structure and organization of files and folders can be a good one to follow some sort of guidelines. I saw Google coding guidelines and I wonder if there's any similar doc around for the subject of this question. I can see that if you create a new project in Xcode (I'm using the latest version) you have one folder

How to make a folder/directory

元气小坏坏 提交于 2020-01-01 07:59:51
问题 How do I make a directory/folder with c++. I've tried to use the mkdir() without success. I want to write a program that cin's a variable and then uses this variable to create sub-directory's and files with in those. my current code. It says the + operator in the mkdir() says error no operand char newFolder[20]; cout << "Enter name of new project without spaces:\n"; cin >> newFolder; string files[] = {"index.php"}; string dir[] = {"/images","/includes","/includes/js","/contact","about"}; for