Questions tagged [dir]

Abbreviation for a directory, a virtual container within a digital file system.

Also a command equivalent to ls in Unix and found in operating systems such as DOS, VMS, and MS Windows.

442 questions
0
votes
2 answers

Windows batch compair two path directories and write out the difference

I want to parse a directory and when new files show up it shoud be listed in a queue for a other batch. I tried it like that: @echo off :START set ftpdir=Z:\FTP\home\ set xdir=Z:\NewDir\ set vtree=v.txt set vtreecomp=vcomp.txt if not exist %vtree%…
Spenhouet
  • 6,556
  • 12
  • 51
  • 76
0
votes
1 answer

CMD How to put DIR's result in variable?

What I tried to do is put dir in "Answer" variable. The variable's result have nothing inside it. What did I do wrong? @echo off set /p name=Program name: echo %name% set Answer=dir /s /a /b C:\%name% echo %Answer% Pause
user2865035
  • 5
  • 1
  • 2
0
votes
1 answer

Objective-C equivalent of the Python dir(someObject) function?

Coming from Python I'm trying to learn Objective-C. When I have an object in Python I can always easily do a dir(myObject) to see what methods it has. So I wonder, what is the equivalent command in Objective-C?
kramer65
  • 50,427
  • 120
  • 308
  • 488
0
votes
2 answers

Can't rename all files in a directory

I need to rename all files to 'DSC0 + num', so the final name of a file should be (for example) 'DSC02015' Attempted code: import os path = "C:\\images" num = 2000 i=0 files = os.listdir(path) for x in files: old = files[i] new = 'DSC0%d'…
Pythonizer
  • 1,080
  • 4
  • 15
  • 25
0
votes
3 answers

Matlab: Include a part of the path to file when using dir command

I'm trying to get a path to all the jpeg files in a directory including 'fig'. This code below gets all the jpeg files in the directory, however does not exclude any 'rft' labeled files. base_directory = '/home/user/data/'; directories =…
FireSky
  • 181
  • 4
  • 17
0
votes
1 answer

How to Keep Score Counter

So I have my word batch game I'm working on in Windows 7. I'm going to implement a scoring system into it but I first must know how to actually do one. So after an easy level is completed I want it to add 25 points to a point counter. Then at a…
user2507295
  • 159
  • 1
  • 2
  • 6
0
votes
3 answers

Python dir() function with regex filtering options

dir() returns a list of all the names, comprising the attributes of the given object and of attributes reachable from it But, I want the ability to regex filter the results of dir() in a simple manner, similar to the unix grep tool >>>…
Pranjal Mittal
  • 10,772
  • 18
  • 74
  • 99
0
votes
0 answers

Delete "old" backups in directory according to file timestamps

SOLVED (forgot it was an associative array): foreach($list_s as $file => $timestamp) { echo $file; unlink($dir_files . $file); unlink($dir_sql . $file); } I have a backup area and I want every time the user visits it for it to run a…
Alex
  • 9,215
  • 8
  • 39
  • 82
0
votes
3 answers

Listing certain extensions in PHP Dir List

Have the following to provide a dir list in an array for($index=0; $index < $indexCount; $index++) { if (substr("$dirArray[$index]", 0, 1) != ".") { // don't list hidden files echo "
Chris P
  • 51
  • 2
  • 6
0
votes
2 answers

Simple wildcard use

EDIT: I have just changed the if to an if else IF "%CD:~1%"==":\" ( set FIR=%CD:~0,2% ) ELSE ( set FIR=%CD% ) Trying to use a wildcard to detect if a batch file is on the root directory (As root causes there to be a backslash at the end of…
Built on Sin
  • 351
  • 2
  • 6
  • 19
0
votes
1 answer

Get the system root dirs?

I know there a lot of path API's in python, but I am looking for an API that will give me the very root directories of the system the script is executing in. Not root directories of the script itself but the actual system. So, for a standard…
More Than Five
  • 9,959
  • 21
  • 77
  • 127
0
votes
1 answer

How do I look at dir(list) or dir(str) in cgi script? (python 3)

In python (IDLE) itself, I know if I type dir(list), I get a list of the properties of list as seen below: >>> dir(list) ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__doc__', '__eq__', '__format__', '__ge__',…
Student J
  • 203
  • 1
  • 5
  • 13
0
votes
0 answers

ls vs. dir in cygwin/uwin in Windows 7

I was trying to process a directory of over 10000 files using ksh in Cygwin in Windows 7 and have found that it can take well over a minute before processing can begin because I start by doing an ls -r | while read.... I can get all the files in a…
Ban Atman
  • 177
  • 2
  • 3
  • 10
0
votes
4 answers

Dir /b with "/" as last character when a folder

I use dir /b > test.txt in order to get a list of all files and folders in my current directory. Is there a way to have : normal filename if it is a file, example blabla.txt "/" at the end if it is a folder, example myfolder\ ? Thanks.
Basj
  • 41,386
  • 99
  • 383
  • 673
0
votes
2 answers

Error 53 when checking if file exists

I am using the following code to check if a file exists: If Len(Dir$(strFile)) > 0 Then This worked fine until today. In some cases I get the following error: The error points to the line of code above. I know the file doesn't exist, but I don't…
Hrqls
  • 2,944
  • 4
  • 34
  • 54