directory

Xcode: directory file for simulator Iphone

好久不见. 提交于 2019-12-20 08:29:05
问题 i want to write a string in a file "file.txt": this file in my project (for Iphone) is inside Resources; I try to write a string in this file but it don't work, I show my code. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"file.txt"]; NSError *error; [outputString writeToFile:filePath atomically:YES encoding

How do I find where ElasticSearch is installing my plugins?

不问归期 提交于 2019-12-20 08:04:21
问题 I have installed elasticsearch with brew install elasticsearch . My plugins seem to reside in /usr/local/Cellar/elasticsearch/0.19.8/plugins . With cat $( which plugin ) I see a ES_HOME variable that contains the correct path. Is there a way to ask elastic for ES_HOME or the plugins directory? EDIT What I am looking for is the directory used by the plugin executable to install the plugins when I do plugin -install something . I want to use that path in a script to fire up elastic search. 回答1:

How to filter files when using scp to copy dir recursively?

不想你离开。 提交于 2019-12-20 07:58:36
问题 I need to copy all the .class files from server to local with all dir reserved. e.g. server:/usr/some/unknown/number/of/sub/folders/me.class will be /usr/project/backup/some/unknown/number/of/sub/folders/me.class the problem is, there are many other useless files such as .svn-base files that i don't want. how can i filter them so I only scp .class files? 回答1: I'd probably recommend using something like rsync for this due to its include and exclude flags, e.g:- rsync -rav -e ssh --include '*/'

Rename all files in a folder using batch

て烟熏妆下的殇ゞ 提交于 2019-12-20 07:37:09
问题 I would like to create a batch file to rename all the files with extension ".log" in a folder to append with today's date. For example : App.log will be appended to App.log06112010 where date is 06112010. Please suggest 回答1: forfiles /m *.log /c "cmd /c ren @file @file06112010" 回答2: #!/usr/bin/ksh export TODAYSDATE=`date "+%m%d%Y"` umask 000 for filename in $1 do if [ ! -f $1 ]; then echo "$filename doesn't exist!" else if [ -d $1 ]; then echo "Skipping directory $filename..." else mv

Rename all files in a folder using batch

丶灬走出姿态 提交于 2019-12-20 07:37:04
问题 I would like to create a batch file to rename all the files with extension ".log" in a folder to append with today's date. For example : App.log will be appended to App.log06112010 where date is 06112010. Please suggest 回答1: forfiles /m *.log /c "cmd /c ren @file @file06112010" 回答2: #!/usr/bin/ksh export TODAYSDATE=`date "+%m%d%Y"` umask 000 for filename in $1 do if [ ! -f $1 ]; then echo "$filename doesn't exist!" else if [ -d $1 ]; then echo "Skipping directory $filename..." else mv

Running command line on multiple music files

夙愿已清 提交于 2019-12-20 07:19:07
问题 I am using a CLI program called metaflac (http://flac.sourceforge.net/documentation_tools_metaflac.html) to remove padding from various FLAC music files on my computer. Using the following command in a batch file (with metaflac.exe in the same folder) successfully completes this task for an individual file: metaflac --dont-use-padding --remove --block-type=PADDING "filename.flac" I have to do this for several thousand files and don't want to do it all manually/individually. Is there an easy

New file in same directory as input file . Python

徘徊边缘 提交于 2019-12-20 07:16:50
问题 import sys,os name_list = open(sys.argv[1]).read().split('\r') os.remove(sys.argv[1]) input_file = (sys.argv[2]) def Extractor(input,output='query.txt'): query = open(input,'r').read().split('\r') dir,file=os.path.split(input) temp_out= os.path.join(dir,output) out_file=open(temp_out,'w') print Extractor(input_file) I have no idea why this isn't working . . . i am trying to create a new file in the same directory as the input file but it is saying that there is an error . i'm not used to

How to avoid Navigation of folders through URL manipulation

十年热恋 提交于 2019-12-20 07:09:01
问题 Please i need your help with my website (testing stage). I have a file system of this nature... www (root) { school { //main project folder images //images folder uploads //user uploads folder JavaScripts //JS folder CSS // css folder includes //includes folder index.php contactus.php aboutus.php register.php } //main project folder } //www folder how can i prevent users from browsing through my folder system when they do somrthing like these: http://127.0.0.1/school/css http://127.0.0.1

How to check a directory has a read/write permission

冷暖自知 提交于 2019-12-20 07:04:34
问题 I have a directory as shown d-wx--x--x 2 bcheudev bcheudev 4096 Jun 18 06:16 test which shows the directory does not have read permission. But when i check the same through shell script it's giving result as dir test has read permission. export IN_DIR=$MMHOME/test if [ -d ${IN_DIR} ] then if [ ! -r ${IN_DIR} ] then echo "${IN_DIR} Directory is not readable.">>$log_name exit 255 fi else echo "${IN_DIR} Directory does not Exists.">>$log_name exit 255 fi inside second if it's not going. Please

Alert user when the user manually moves an email to an Archive folder

安稳与你 提交于 2019-12-20 06:28:22
问题 I have found myself accidentally moving email items to an Archive folder instead of the standard folder in MS Outlook. For example, for an email address of Example@Email.Com, I open the Archive to locate an old email in folder "KeepThis" but then I forget to collapse the Archive folder and so I inadvertently move some other email message later on into the Archive/KeepThis folder when I really wanted to move it to the Example@Email.Com/KeepThis folder. Is there a way to use VBA code to alert