filenames

How do I write some (bash) shell script to convert all matching filenames in directory to command-line options?

烈酒焚心 提交于 2019-12-06 13:32:11
问题 Apparently the answer to my question "Can I restrict nose coverage output to directory (rather than package)?" is no, but I can pass a --coverage-package=PACKAGE option to nose with the package name of each .py file in the directory. So for example, if the directory contains: foo.py bar.py baz.py ...then I would need to use the command: nosetests --with-coverage --coverage-package=foo --coverage-package=bar --coverage-package=baz So my question is, can someone write some shell script code

Why can't PHP find long filenames?

ⅰ亾dé卋堺 提交于 2019-12-06 12:24:18
inside a Folder I have a file, named `111-aaaaaa aa aaaa-,._aaaaaaa; aaaaaaaa, aa aaaaaaaaaa, aaaaaaaaa aaaaaaaa. 03.01.10. 38.38 aaaaa.txt` when I browse that directory with PHP (or trying to read that file): var_dump(glob('MyFolder/*'));exit; It can't find that file. What's problem? (if I shorten the filename, then it becomes findable. I am on windows) Windows in particular has a very short file name limit in its original Win32 API. This general problem is discussed here at SO . At most about 260 characters can be used in an absolute path on Win32. On other platforms there are other limits,

Filename from URL not containing filename suffix

核能气质少年 提交于 2019-12-06 12:14:46
问题 I need to download a file from a URL except I don't know what type the file will be and the URL I am using doesn't have /random.file at the end of it so I can't parse the url for the filename. At the moment I'm using the Android download manager which works greats and means I don't have handle the download but I can't see anyway to get the file name out of the file its downloading. If I load the same url in Firefox for example it asks 'Download file: Nameoffile.extension'. Is there a way for

What naming conventions exist for the primary Node.js file?

只谈情不闲聊 提交于 2019-12-06 11:08:12
This question has been completely edited in hopes that it will be reopened. The naming of the main Node.js file is something left to the user and and does not seem to be defined by any well established convention. In hopes of finding a good name, I am curious if there are naming conventions in other parts of the Node.js ecosystem that might suggest a name to use. Some names I have seen are: app.js , index.js , main.js , server.js , etc. Please provide only well documented standards in answers. NPM seems to suggest a standard whereby one can define the primary file in the package.json file like

Automated renaming of linux filenames to a new filenames that are legal in windows

感情迁移 提交于 2019-12-06 07:26:26
问题 I would like to rename a linux file to a filename that is legal in windows. It should not be longer than is allowed and should not have characters that are not allowed in windows. Sometimes I copy the title from papers to a filename and they have special characters such as – , ® , or ? Also there is there are some kind of characters sometimes at the ends of lines generated when copying and pasting a title from a pdf. You can see them when using sed -n 'l': echo 'Estrogen receptor agonists and

Git diff fails on file with underscore in path

╄→гoц情女王★ 提交于 2019-12-06 03:30:44
I'm running Windows 7, and I have the latest version of git (2.7.2.windows.1). I previously used Windows PowerShell as my terminal for git operations, with no issues. Recently, I decided to switch to Git Bash, but I'm having one major issue. My project has a directory (within which are many subdirectories) whose name is simply an underscore. Whenever I try to run git diff on a file within that directory, I get the following error: $ git diff _/css/templates/jquery.tag-editor.css fatal: Invalid object name '_C'. As far as I know, an underscore is a perfectly valid character in a file/directory

Colon/Asterisk as a filename delimiter?

我的未来我决定 提交于 2019-12-06 02:15:42
问题 I'm looking for a character to use a filename delimiter (I'm storing multiple filenames in a plaintext string). Windows seems not to allow : , ? , * , < , > , " , | , / and \ in filenames. Obviously, \ and / can't be used, since they mean something within a path. Is there any reason why any of those others shouldn't be used? I'm just thinking that, similar to / or \ , those other disallowed characters may have special meaning that I shouldn't assume won't be in path names. Of those other 7

file name with special characters like “é” NOT FOUND

被刻印的时光 ゝ 提交于 2019-12-05 23:14:13
I have a folder on my website just for random files. I used php opendir to list all the files so i can style the page a bit. But the files that I uploaded with special characters in them don't work. when i click on them it says the files are not found. but when i check the directory, the files are there. seems like the links are wrong. any idea how i can get a correct link to these file names with special characters in them? This is tricky. It depends what encoding your filesystem uses for filenames and how (if) your webserver or PHP functions convert the encoding. First of all, make sure your

Change file name for download and start downloading it after click or delay

♀尐吖头ヾ 提交于 2019-12-05 20:06:13
I'm looking for php code that changes file name -adds current date, and starts download the file with delay. If download will not start there is an option to download the file with added date by clicking the link. Something like this: Your download will begin in a few moments... If nothing happens, click <a href="">here</a> . I found only this: // It will be called downloaded.pdf header('Content-Disposition: attachment; filename="downloaded.pdf"'); // The PDF source is in original.pdf readfile('plik.pdf'); https://stackoverflow.com/a/6694505 Please help me. You will need two parts to do this

How to control base64 images when user saves as

孤街浪徒 提交于 2019-12-05 17:09:26
I'm making an app where i want to show the user a range of base64 encoded picture. They are shown by using data-url. If the user wants to save a picture, it can simply rightclick and save as (or drag it into a folder). Are there any way to control the sugested filename? Right now Chrome just sugest "download" and doesn't even recognize it as an image. Can this be done in any way? I only need it to work in Chrome. Thanks for any help Make sure you are setting the proper mime type for the image in the data uri. Doing this fixed the file extension in Chrome 17, for me. The file was downloaded as