directory

How to ignore the single and double dot entries in Perl's readdir?

微笑、不失礼 提交于 2019-12-20 03:34:55
问题 Following up from here: Perl Imgsize not working in loop? I have another question - how do I not let perl list the single and double dot entries when it reads the files in a directory? As in the linked question above, my output to the while loop ( while ($file = readdir($dh)) ) is something like this: . .. file1.jpg file2.jpg file3.jpg file4.jpg file5.jpg And this creates problems because I've also got a counter somewhere, which is counting my files. And . and .. don't count as files, so my

Excel vba reading large amount of files faster

。_饼干妹妹 提交于 2019-12-20 03:21:22
问题 I have written a code that finds all files starting with a specific name and reads data from them, there is usually 1k files or more in the folder, I wrote a little benchmark and realize that my code reads approx 1 file per second and that is a lot of time. I am pretty new to VBA, and I was wondering if I took a wrong approach to this? Function Code: Function ReadDataFromWorksheet() Dim XL As Excel.Application Dim WBK As Excel.Workbook Dim i As Integer i = 1 Set XL = CreateObject("Excel

Windows Server 2008 R2 配置AD(Active Directory)域控制器

六眼飞鱼酱① 提交于 2019-12-20 03:10:38
目录 配置环境 配置DNS服务器 配置Active Directory 域服务 C# AD(Active Directory)域同步 组织单位、用户等信息查询 PDF下载 配置环境 Windows版本:Windows Server 2008 R2 Enterprise Service Pack 1 系统类型: 64 位操作系统 配置DNS服务器 这一步不是必须的,在安装Active Directory 域服务时可以同时装上DNS服务器。 Active Directory 域服务安装向导--> 其它域控制服务器 ,勾上DNS服务器也有同样效果, 鉴于服务器配置容易出现一些未知小错误,还是提前安装上比较省心^_^! 开始菜单-->管理工具-->服务器管理器 选择左侧树形菜单“角色”节点,右键“添加角色”      点击“下一步按钮”         勾选“DNS 服务器”     点击“下一步”按钮       点击“下一步”按钮    点击“安装”按钮          点击“关闭”按钮,重启服务器!       DNS服务器安装完成! 配置Active Directory 域服务    开始菜单-->运行-->输入命令“dcpromo”à点击“确定” 按钮       进入安装界面       弹出 Active Directory 域服务安装向导,并点击“下一步”按钮     

Determine if Program is Run from CMD or from Explorer [duplicate]

旧城冷巷雨未停 提交于 2019-12-20 02:27:47
问题 This question already has answers here : How can I get the PID of the parent process of my application (4 answers) How to get parent process in .NET in managed way (6 answers) Closed 6 years ago . In C#, is there a way to determine if program has been run from the command line (CMD.exe) or from explorer (any folder view, etc.)? Thanks. 来源: https://stackoverflow.com/questions/17508093/determine-if-program-is-run-from-cmd-or-from-explorer

Is it possible to create shortcuts into a specific directory in python?

ε祈祈猫儿з 提交于 2019-12-20 02:11:14
问题 I looked over the inetrnet but found nothing about this so I ask here - Is it possible to create a shortcut of a file and put it in a specific directory of my choose with python? For example, I have a folder named "EXAMPLE" in ' C: ' . I want to create automatically a shortcut of Google Chrome and put it in this folder. Is it possible to do so using python(and not just dragging it over by myself)? Thanks 回答1: I assume because of you mention C: that you're using windows. So you can use

how to get directory name by inode value in c?

╄→尐↘猪︶ㄣ 提交于 2019-12-20 02:05:35
问题 i am tring to add a new feature to bash and the job need a func to get the directory name from the given inode value so how to got this work? i mean if there's some builtin func in bash's source code if not , any help will be accept 回答1: List the directory and get the inode of .. then list that and find the name of the file there that has the inode you are looking for. 回答2: This is impossible without searching through the filesystem for a dir that contains a file with the given inode.

how to create password to folder using c#

为君一笑 提交于 2019-12-20 01:59:16
问题 how to create password to windows folder using c# shall I set password to folders when it is created. 回答1: You can't set a password on a folder in either FAT32 or NTFS, however you can set up so that only certain user accounts can access it using the DirectorySecurity class. There's some sample code in that link. 回答2: Something like this cannot be done using C#. The only real reliable way of achieving something like this is to write a kernal-mode File System Filter Driver. If you install the

Check whether a folder exists in a path in c#?

ぃ、小莉子 提交于 2019-12-19 19:45:35
问题 How to check whether a folder named RM exists inside a directory...I have given the directory path through textbox like txtBoxInput.Text and in this path i have to check...Any suggestion? 回答1: Path.Combine and Directory.Exists ? http://msdn.microsoft.com/en-us/library/system.io.path.combine.aspx http://msdn.microsoft.com/en-us/library/system.io.directory.exists.aspx if (Directory.Exists(Path.Combine(txtBoxInput.Text, "RM")) { // Do Stuff } 回答2: You can use Directory.Exists() to test whether a

Command not found in Bash's IF-ELSE condition when using [! -d “$DIR”]

左心房为你撑大大i 提交于 2019-12-19 17:17:11
问题 I have a code like this #!/bin/bash DIR="test_dir/"; if [! -d "$DIR"]; then # If it doesn't create it mkdir $DIR fi But why executing it gave me this: ./mycode.sh: line 16: [!: command not found What's the right way to do it? 回答1: Add space between [ and !. And before ] as well. #!/bin/bash DIR="test_dir/"; if [ ! -d "$DIR" ]; then # If it doesn't create it mkdir $DIR fi It's also a good idea to quote your variable: mkdir "$DIR" 回答2: Add some spaces: if [ ! -d "$DIR" ]; then # ^ ^ 回答3: You

How to get file from directory with pattern/filter

折月煮酒 提交于 2019-12-19 17:15:04
问题 I have to get a file from a PDF files directory. I have problem that I haven't a field to concant all data to find the file. Here's an example: File name: Comp_20120619_170310_2_632128_FC_A_8_23903.pdf File name generate: Comp_20120619_--------_2_632128_FC_A_8_23903.pdf I dont' have the field "--------" to make file COMPLETE name. I'm trying with File.list but I cannot find the correct file. 回答1: You can define a FilenameFilter to match against the filenames, and return true if the filename