天道酬勤,学无止境

Getting list of all folders but not the files

I am trying to use the svn commands to gather all folders and subfolders from svn. The list is huge.

I have tried making an empty folder on svn and compare it with the base but it crashes after 4 hours.

I have tried the following this morning :

svn list --depth infinity http://serverip/svn/root/ 

and it has been running for nearly 6 hours so far and still not finished and it lists all the files.

I tried on the side a couple other ways with grep and egrep parameters but it is not recognized so i believe they might be Bash commands and i am on windows so that would explain why it's not doing anything good.

All i want is all folders and subfolders within the root. And if possible with the command i would filter on specific folder names like "/tag-088/121359/". If i cannot filter in the command it's not a big deal it's very easy to filter myself within excel or something like that. The main goal is to only pick folder and subfolder and not files.

I have about 4.2 terabyte svn so it is a bit slow probably because of that so that is why i am trying to list without the files.

标签

评论

If you have access to the server (which I assume you do, given that you know well the size of the repository), you might consider using the svnlook program. Like svn, svnlook offers a collection of subcommands. You'll want the svnlook tree subcommand, and specifically the --full-paths option which causes it to print its output one-path-per-line instead of using a nested/indented approach. Piped through a grep that keeps only output which ends in a slash character (true only of directory paths), you'll have the list you seek.

$ svnlook tree /path/to/repos --full-paths | grep '/$'
/
/trunk/
/trunk/dir/
/trunk/otherdir/
/tags/
/tags/my-tag/
/tags/my-tag/dir/
/tags/my-tag/otherdir/
...

受限制的 HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。

相关推荐
  • 获取当前目录中所有子目录的列表(Getting a list of all subdirectories in the current directory)
    问题 有没有办法在Python中返回当前目录中所有子目录的列表? 我知道您可以使用文件来执行此操作,但是我需要获取目录列表。 回答1 您是指直接子目录,还是树下的每个目录? 无论哪种方式,您都可以使用os.walk来执行此操作: os.walk(directory) 将为每个子目录生成一个元组。 该三元组中的第一个条目是目录名称,因此 [x[0] for x in os.walk(directory)] 应该递归地给你所有的子目录。 请注意,该元组中的第二个条目是该条目的子目录列表的第一个位置,因此您可以改用它,但是不太可能为您节省很多。 但是,您可以使用它来为您提供直接的子目录: next(os.walk('.'))[1] 或使用os.listdir和os.path.isdir查看已发布的其他解决方案,包括“如何在Python中获取所有直接子目录”中的解决方案。 回答2 您可以只使用glob.glob from glob import glob glob("/path/to/directory/*/") 别忘了*后面的/ 。 回答3 import os d = '.' [os.path.join(d, o) for o in os.listdir(d) if os.path.isdir(os.path.join(d,o))] 回答4 比上面的要好得多,因为您不需要几个os
  • C#:获取文件夹中的所有图像文件(C#:Getting all image files in folder)
    问题 我正在尝试从文件夹中获取所有图像,但是,该文件夹还包括子文件夹。 例如/ photos / person1 /和/ photos / person2 /。我可以在文件夹中获取照片 path= System.IO.Directory.GetCurrentDirectory() + "/photo/" + groupNO + "/"; public List<String> GetImagesPath(String folderName) { DirectoryInfo Folder; FileInfo[] Images; Folder = new DirectoryInfo(folderName); Images = Folder.GetFiles(); List<String> imagesList = new List<String>(); for (int i = 0; i < Images.Length; i++) { imagesList.Add(String.Format(@"{0}/{1}", folderName, Images[i].Name)); // Console.WriteLine(String.Format(@"{0}/{1}", folderName, Images[i].Name)); } return imagesList; } 但是
  • How to match and move files into corresponding folders using Python
    I am fairly new to programing and this is my first stab at creating a complex script using Python The purpose of the program I am creating is: to go through a list of files (360 files altogether in a single folder) extract 3 unique characters in the file name and create a folder based on the 3 characters (60 unique folders altogether) create a for loop which goes through the list of files in the source folder and moves it to its corresponding target folder. Example: file name: KPHI_SDUS81_N3KDIX_201205261956 folder created based on characters: N3K import os #Creates a list based on file names
  • 如何使用Python匹配并移动文件到相应的文件夹中(How to match and move files into corresponding folders using Python)
    问题 我对编程还很陌生,这是我第一次尝试使用 Python 创建复杂的脚本 我正在创建的程序的目的是: 浏览文件列表(单个文件夹中共有 360 个文件) 提取文件名中的 3 个唯一字符,并根据 3 个字符创建一个文件夹(共 60 个唯一文件夹) 创建一个 for 循环,它遍历源文件夹中的文件列表并将其移动到其相应的目标文件夹。 例子: 文件名: KPHI_SDUS81_N3KDIX_201205261956 基于字符创建的文件夹: N3K import os #Creates a list based on file names in the folder srcfile=os.listdir("E:\\Learning Python\\Testing out\\thunderstorm stuff") #Directiory of where the source files are located srcpath= "E:\\Learning Python\\Testing out\\thunderstorm stuff" #Creates a list based on the location of where folders will be lcoated. #List will be empty since for loop has not ran yet
  • 列出 AWS S3 存储桶的特定“文件夹”中的文件(Listing files in a specific “folder” of a AWS S3 bucket)
    问题 我需要列出 S3 存储桶中某个文件夹中包含的所有文件。 文件夹结构如下 /my-bucket/users/<user-id>/contacts/<contact-id> 我有与用户相关的文件和与某个用户的联系人相关的文件。 我需要列出两者。 要列出我正在使用此代码的文件: ListObjectsRequest listObjectsRequest = new ListObjectsRequest().withBucketName("my-bucket") .withPrefix("some-prefix").withDelimiter("/"); ObjectListing objects = transferManager.getAmazonS3Client().listObjects(listObjectsRequest); 要列出某个用户的文件,我使用了这个前缀: users/<user-id>/ 并且我正确地获取了目录中不包括contacts子目录的所有文件,例如: users/<user-id>/file1.txt users/<user-id>/file2.txt users/<user-id>/file3.txt 为了列出某个用户联系人的文件,我使用了这个前缀: users/<user-id>/contacts/<contact-id>/ 但在这种情况下
  • git - 获取特定文件/文件夹的所有先前版本(git - getting ALL previous version of a specific file/folder)
    问题 我想在 git 存储库中检索特定文件的所有先前版本。 我看到可以使用 checkout 命令获得一个特定版本,但我想要所有版本。 带有深度选项的 git clone 命令似乎不允许我克隆子文件夹(“无效的存储库名称”)。 你知道这是否可能以及如何实现? 谢谢 回答1 OP 想要检索所有版本,但无法提供答案。 特别是如果文件有数百个修订版(所有建议都太手动了)。 @Tobias 在评论中提出了唯一的半工作解决方案,但建议 bash 循环会以随机顺序构建文件,并且在针对我们的存储库使用时会生成数百个空文件。 原因之一是“rev-list --all --objects”会列出不同的对象(包括树 - 但对我们的目的无用)。 我从 Tobias 的解决方案开始,添加了计数器,清理了一下,最终以下面列出的 bash 脚本的形式重新发明了轮子。 该脚本将: 将所有文件版本提取到 /tmp/all_versions_exported 取 1 个参数 - git repo 中文件的相对路径给结果文件名数字前缀(可排序) 在结果文件中提及检查的文件名(区分苹果和橙子:) 在结果文件名中提及提交日期(参见下面的输出示例) 不创建空结果文件 cat /usr/local/bin/git_export_all_file_versions #!/bin/bash # we'll write all
  • Android Thumbnails inside MediaStore isn't getting refreshed after calling MediaScannerConnection.scanFile
    I'm trying to build a Gallery-like app which will perform the following functions on External storage: List all the folder that has images inside it List all the images that available to the public (will not probe the files inside Android/data) So far I can list all the images, and folders that have images. However, I later find that these images and folders are not the newest ones: they are not getting refreshed after I put some pictures (say I simply do some screenshots or download some pictures). And new pictures are not appear even after I call MediaScannerConnection.scanFile. Except the
  • 调用 MediaScannerConnection.scanFile 后,MediaStore 中的 Android 缩略图未刷新(Android Thumbnails inside MediaStore isn't getting refreshed after calling MediaScannerConnection.scanFile)
    问题 我正在尝试构建一个类似画廊的应用程序,它将在外部存储上执行以下功能: 列出所有包含图像的文件夹列出所有可供公众使用的图像(不会探测Android/data的文件) 到目前为止,我可以列出所有图像和包含图像的文件夹。 但是,后来我发现这些图片和文件夹不是最新的:我放了一些图片后它们没有刷新(比如我只是做一些截图或下载一些图片)。 即使在我调用MediaScannerConnection.scanFile之后也不会出现新图片。 除了MediaScannerConnection ,我还尝试了使用指定文件夹的昂贵Intent.ACTION_MEDIA_SCANNER_SCAN_FILE方法,但没有运气。 我浏览了 StackOverflow 以及与人们讨论这个问题的各种来源,但没有一个可以提供工作方法。 我检查/尝试过的来源: http://droidyue.com/blog/2014/01/19/scan-media-files-in-android/ 在特定路径(文件夹)上触发 mediascanner,如何? 代码: 我如何列出所有图像: private String[] projectionThumbnail = new String[]{MediaStore.Images.Thumbnails._ID, MediaStore.Images.Thumbnails.IMAGE
  • How to recursively copy entire directory including parent folder in Java
    I am currently coping folders from one place to another. It is working fine out but it is not copying the original folder that all the rest of the files and folders are in over as well. This is the code I am using: public static void copyFolder(File src, File dest) throws IOException { if (src.isDirectory()) { //if directory not exists, create it if (!dest.exists()) { dest.mkdir(); } //list all the directory contents String files[] = src.list(); for (String file : files) { //construct the src and dest file structure File srcFile = new File(src, file); File destFile = new File(dest+"\\"+src
  • Listing all files on my computer and sorting by size
    Recently I've come into the problem that my hard drive is getting obnoxiously full, but after going through my personal files and deleting/moving all of the oversized video files, I still have a rather small amount of ROM available. So I put my programmer brain to work and decided that instead of meticulously going through each folder and subfolder myself and using the right-click + Properties function of Windows to see how big a file is and whether or not its worth keeping around, I could write a simple code that would search for every file on my computer, throw it into a list by its full
  • 列出我电脑上的所有文件并按大小排序(Listing all files on my computer and sorting by size)
    问题 最近我遇到了一个问题,我的硬盘驱动器越来越满,但在浏览我的个人文件并删除/移动所有超大视频文件后,我仍然有相当少量的 ROM 可用。 所以我让我的程序员大脑开始工作,并决定与其自己仔细检查每个文件夹和子文件夹并使用 Windows 的右键单击 + 属性功能来查看文件有多大以及是否值得保留,我可以编写一个简单的代码来搜索我计算机上的每个文件,将其按完整路径名放入一个列表中,然后将其文件大小放在旁边,然后按文件大小从最大到最小排序。 所以我跳到网上,开始做研究,那时一切都对我来说很有吸引力。 我发现了大量适用于他们指定任务的代码片段,但是每当我尝试自己使用它们时,我都会遇到大量构建错误。 也就是说,到目前为止我发现的最有希望的事情是: const string dir = "C:\\"; string[] fns = Directory.GetFiles(dir); var Sort = from fn in fns orderby new FileInfo(fn).Length descending select fn; foreach (string n in Sort) Console.WriteLine(n); 不幸的是,这不会触及任何子目录。 我已经查找了如何从子目录中获取文件,但是尝试将这些代码片段与此代码片段集成证明比我想象的要麻烦得多。
  • 获取文件夹中所有文件的文件名[重复](Getting the filenames of all files in a folder [duplicate])
    问题 这个问题已经在这里有了答案: 如何从Java读取文件夹中的所有文件? (32个答案) 去年关闭。 我需要使用文件夹中文件的所有名称创建一个列表。 例如,如果我有: 000.jpg 012.jpg 013.jpg 我想将它们存储在以[000,012,013]作为值的ArrayList 。 用Java做到这一点的最好方法是什么? PS:我在Mac OS X上 回答1 您可以这样做: File folder = new File("your/path"); File[] listOfFiles = folder.listFiles(); for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile()) { System.out.println("File " + listOfFiles[i].getName()); } else if (listOfFiles[i].isDirectory()) { System.out.println("Directory " + listOfFiles[i].getName()); } } 您只想获取JPEG文件还是所有文件? 回答2 创建一个File对象,将目录路径传递给构造函数。 使用listFiles()检索目录中每个文件的File对象数组
  • List children API doesn't give all the children of the drive/folder
    I am facing the following issue while getting files/folders for OneDrive of a user. On hitting https://graph.microsoft.com/v1.0/users/{user-id}/drive I get this in the response: "quota": { "deleted": 0, "remaining": 0, "total": 0, "used": 0 } which denotes that the drive isn't being used or is empty. On hitting https://graph.microsoft.com/v1.0/users/{user-id}/drive/root I get the response - "folder": { "childCount": 21 }, "root": {}, "size": 281236319 Here, it denotes that there are 21 files/folders in the drive's root folder and they occupy 281.23 MB of space. Now, on hitting https://graph
  • 使用C#从文件夹获取所有文件名(Getting all file names from a folder using C# [duplicate])
    问题 这个问题已经在这里有了答案: 如何递归列出C#目录中的所有文件? (22个答案) 8年前关闭。 我想知道是否可以在某个文件夹中获取所有文本文件名称。 例如,我有一个名为Maps的文件夹,我想获取该文件夹中所有文本文件的名称,并将其添加到字符串列表中。 有可能吗?如果可以,我该如何实现呢? 回答1 DirectoryInfo d = new DirectoryInfo(@"D:\Test");//Assuming Test is your Folder FileInfo[] Files = d.GetFiles("*.txt"); //Getting Text files string str = ""; foreach(FileInfo file in Files ) { str = str + ", " + file.Name; } 希望这会有所帮助... 回答2 using System.IO; //add this namespace also string[] filePaths = Directory.GetFiles(@"c:\Maps\", "*.txt", SearchOption.TopDirectoryOnly); 回答3 这取决于您想做什么。 参考:http://www.csharp-examples.net/get-files-from
  • C#谷歌驱动sdk。 如何获取谷歌驱动器文件夹列表?(C# Google drive sdk. How to get a list of google drive folders?)
    问题 我正在编写一个程序来允许用户将文件上传到他们的 Google Drive 帐户。 我有上传部分工作并且正在使用 OAuth2。 我目前遇到的问题是从用户 Drive 帐户获取文件夹列表。 我发现一些应该使用 .setUserCredentials 方法执行此操作的代码,但它不起作用: DocumentsService service1 = new DocumentsService("project"); service1.setUserCredentials("user","pass"); FolderQuery query1 = new FolderQuery(); // Make a request to the API and get all documents. DocumentsFeed feed = service1.Query(query1); // Iterate through all of the documents returned foreach (DocumentEntry entry in feed.Entries) { var blech = entry.Title.Text; } 什么都没有返回。 理想情况下,我想使用 OAuth2 来做到这一点。 我一直在尝试使用以下代码,尝试设置身份验证令牌,但总是被拒绝访问: String CLIENT
  • Is there a TFS Git API for getting file last modified date of files in a folder?
    I am using TFS Git API to programmatically read data from my Git repository. I have the requirement that I need to be able to get a folder from the git repository and list all of the files in it and their last modified timestamp. I am using the items api and I am able to get the items in a folder with this request: https://docs.microsoft.com/en-us/rest/api/azure/devops/git/items/list?view=azure-devops-rest-5.1 For example: GET https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/items?scopePath=/MyWebSite/MyWebSite/Views&recursionLevel=Full
  • Photoshop脚本入门(二)- JavaScript脚本参考
    JavaScript脚本参考是基于DOM文档对象模型的资料 一、Adobe Photoshop CC 提供JavaScript支持 本参考资料描述了Adobe®Photoshop®CC®JavaScriptTMtype库中的对象和方法。一个配套的文档, Photoshop CC脚本指南,描述了基本的脚本概念和Photoshop对象模型。本文档提供了Photoshop对 象模型的参考细节,以及关于javascript特定特性的附加信息。 Adobe Photoshop CC使用了ExtendScript,这是Adobe对JavaScript的扩展实现。有关更多信息,请参 见adobephotoshopcc.com中的JavaScript支持。 本书包括以下章节: ●本介绍介绍了adobephotoshopcc中的脚本支持,并列出了对自上次发布以来的JavaScript接口。 ● JavaScript对象引用,为所有Photoshop DOM对象提供完整的引用命令。 ●脚本常量,列出Photoshop类型库中使用的所有枚举。 要使JavaScript文件被Photoshop识别为有效的脚本文件,它必须使用a.js或a.jsx扩展。 在Mac OS上,脚本使用两个扩展函数的方式没有区别。在Windows上,如果脚本文件是在Photoshop 中打开的,那么使用.js和.jsx没有区别
  • listing all files from specified folders in Google Drive through IOS Google Drive SDK
    Actually i integrated google drive sdk with my ios app. I can able to retrieve/upload the files in google drive through google drive ios sdk. But the retrieving files list from specified parent folder taking so much time. Here the steps and the code which was i am using. First am getting the children's of the specified parent folder then am getting the GTLDriveChildReference of each child then then am querying with the child reference identifier. This is huge process for me. Also it request google server each time. Any better way there to just pass the parent folder id in a query and pulling
  • Android, how do can I get a list of all files in a folder?
    I need the name (String) of all files in res/raw/ I tried: File f = new File("/"); String[] someFiles = f.list(); It looks like the root directory is the root of the android emulator...and not my computers root directory. That makes enough sense, but doesn't really help me find out where the raw folder exists. Update: Thanks for all the great replies. It appears that some of these are working, but only getting me half way. Perhaps a more detailed description will aid I want to get all the mp3 files in the raw folder so I can get all the names, then add them to a URI to play a random MP3 in the
  • C#:Getting all image files in folder
    I am trying to get all images from folder but ,this folder also include sub folders. like /photos/person1/ and /photos/person2/ .I can get photos in folder like path= System.IO.Directory.GetCurrentDirectory() + "/photo/" + groupNO + "/"; public List<String> GetImagesPath(String folderName) { DirectoryInfo Folder; FileInfo[] Images; Folder = new DirectoryInfo(folderName); Images = Folder.GetFiles(); List<String> imagesList = new List<String>(); for (int i = 0; i < Images.Length; i++) { imagesList.Add(String.Format(@"{0}/{1}", folderName, Images[i].Name)); // Console.WriteLine(String.Format(@"{0