filenames

Git pull error: unable to create file (Invalid argument)

前提是你 提交于 2019-11-28 21:08:11
I am trying to sync remote repo with local repo but getting following errors. Some files (which have not extention) are not getting sync with local repo on WINDOWS machine, but I could sync successfully on MAC machine. Is there any configuration settings in WINDOWS to handle such case? Using TortoiseGit Windows 7 64 bit machine ERROR DETAILS git.exe clone --progress -v "https://github.com/xxxx/xxxxx.git" "C:\Data\GitHub\simility\vishesh-common" Cloning into 'C:\Data\GitHub\simility\vishesh-common'... POST git-upload-pack (200 bytes) remote: Counting objects: 3912, done. remote: Compressing

Open file by filename wildcard

只谈情不闲聊 提交于 2019-11-28 19:33:44
I have a directory of text files that all have the extension .txt . My goal is to print the contents of the text file. I wish to be able use the wildcard *.txt to specify the file name I wish to open (I'm thinking along the lines of something like F:\text\*.txt ?), split the lines of the text file, then print the output. Here is an example of what I want to do, but I want to be able to change somefile when executing my command. f = open('F:\text\somefile.txt', 'r') for line in f: print line, I had checked out the glob module earlier, but I couldn't figure out how to actually do anything to the

Create file name using date and time

南楼画角 提交于 2019-11-28 19:12:24
I hope you could help me, I'm trying to call in the date from another class and looks like "2011-03-09 06-57-40", I want to use this to create the file below but everytime I do when the output runs it creates a new file as it re-runs calling the dat(). I know what's going wrong I'm just not sure how to fix it, I want to permently writw to the same file. I hope this makes sense? :/ Thank you for any help in advance :) date d = new date(); String cdate = d.date(); String f = h; try{ PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(cdate + ".tsv", true))); out.print(f); out

DateTime.ToString() format that can be used in a filename or extension?

半城伤御伤魂 提交于 2019-11-28 16:46:45
I want to add a timestamp to filenames as files are created but most of the DateTime methods I've tried output something with spaces and slashes. For instance: Debug.WriteLine(DateTime.Now.ToString()); // <-- 9/19/2012 1:41:46 PM Debug.WriteLine(DateTime.Now.ToShortTimeString()); // <-- 1:41 PM Debug.WriteLine(DateTime.Now.ToShortDateString()); // <-- 9/19/2012 Debug.WriteLine(DateTime.Now.ToFileTime()); // <-- 129925501061462806 ToFileTime() works but is not exactly human-readable. How can I format the output to a human-readable timestamp with date and time that can be used in a filename or

Mac OS X doesn't allow to name files starting with a dot. How do I name the .htaccess file?

泄露秘密 提交于 2019-11-28 16:21:58
As mentioned in the title, Mac OS X doesn't allow me to name files starting with a dot ( . ). But, I need an .htaccess file. Or, better, how do I use an htaccess file in Mac OS X without giving it a name starting with a dot? I am running Mac OS 10.5.8 and XAMPP 1.7.3. You can't do this with the Finder. Open Terminal.app ( Applications -> Utilities -> Terminal ), and type: > cd /path/to/directory/containing/htaccess > mv current_file_name .htaccess Example (do not take directory names or initial filename literally, of course): Arkhaic You can create files that begin with a "." if you can view

How to make a valid Windows filename from an arbitrary string?

。_饼干妹妹 提交于 2019-11-28 16:07:25
问题 I've got a string like "Foo: Bar" that I want to use as a filename, but on Windows the ":" char isn't allowed in a filename. Is there a method that will turn "Foo: Bar" into something like "Foo- Bar"? 回答1: Try something like this: string fileName = "something"; foreach (char c in System.IO.Path.GetInvalidFileNameChars()) { fileName = fileName.Replace(c, '_'); } Edit: Since GetInvalidFileNameChars() will return 10 or 15 chars, it's better to use a StringBuilder instead of a simple string; the

Name a file in Java to include date and time stamp

£可爱£侵袭症+ 提交于 2019-11-28 14:43:32
I am exporting data into a file in a Java application using NetBeans. The file will have a hard coded name given by me in the code. Please find below the code. private static String FILE = "D:\\Report.pdf"; I want to append date and time stamp to the file name generated so that each file created is a unique file. How to achieve this? Use SimpleDateFormat and split to keep file extension: private static String FILE = "D:\Report.pdf"; DateFormat df = new SimpleDateFormat("yyyyMMddhhmmss"); // add S if you need milliseconds String filename = FILE.split(".")[0] + df.format(new Date()) + FILE.split

Delete files with special characters in filenames

时间秒杀一切 提交于 2019-11-28 14:07:06
I need to delete old files with special characters in filenames like space, , , ( , ) , ! and so on via PHP. Classic unlink($filename) does not work for these files. How can I transform filenames to filenames which accepts unlink function and filesystem? It's running on a Solaris machine and I don't have another access to it. How are you constructing the $filename ? unlink should work on any filename with special characters if you do the normal escaping on it. e.g. for a file with a name of this has, various/wonky !characters in it , then $filename = 'this has\, various\/wonky \!characters in

Renaming part of a filename [duplicate]

狂风中的少年 提交于 2019-11-28 13:50:10
问题 This question already has answers here : Rename multiple files based on pattern in Unix (22 answers) Closed 2 years ago . I have loads of files which look like this: DET01-ABC-5_50-001.dat ... DET01-ABC-5_50-0025.dat and I want them to look like this: DET01-XYZ-5_50-001.dat ... DET01-XYZ-5_50-0025.dat How can I do this? 回答1: There are a couple of variants of a rename command, in your case, it may be as simple as rename ABC XYZ *.dat You may have a version which takes a Perl regex; rename 's

for loop through files with spaces and some special characters

99封情书 提交于 2019-11-28 13:02:47
问题 I need to run the following command with a for loop cat Locate\ Message.eml | ./locatePipe.php I am trying the following however it seems to break on the first space in the file name for i in $(find -name "*.eml"); do cat $i | ./locatePipe.php; done Some of the file names contain "@", "()", "-", ".", "[]", " ' " if that matters 回答1: Use the -exec option find -name '*.eml' -exec cat {} + | ./locatePipe.php 回答2: I accomplished this using the following command find -name '*.eml' | while read