w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Apply directory permissions to all new subdirectories in linux
Most unix command come with a recursive option. In this case: -R, --recursive It seems like you are trying to use this, but you have -Rm. That is not the correct option. I think what you need is: sudo setfacl -R -m g:users:rwX,d:g:users:rwX index/ I typically use chmod instead of setfacl. chmod -R 777 *

Categories : Linux

not found [No such file or directory] error, even though the file present in that directory on RH Linux 6.2
Enter this: ls -ls /data/RAIL/rpo402/db/upgrade List the output for the file and look at it's permissions. Make sure the file isn't empty. Make sure the file has permissions to be executed as a shell. chmod +x upgrade_db.ksh Look at the first line of the file, make sure it has a proper header for a shell script. Maybe Korn Shell requires the shell declaration in the header. Check dmesg to see if there are any error messages, perhaps the file system and check inodes.

Categories : Linux

How to access a file in a directory from other directory, when both are in same parent directory with HTML
if dir1 and dir2 are in the same parent directory then this is how you access 2.html from 1.html: <a href="../dir2/2.html">link to 2.html</a> hope it helped :)

Categories : HTML

Directory permissions to a php file
try this <?php chmod("/somedir/somefile", 755); // decimal; probably incorrect chmod("/somedir/somefile", "u+rwx,go+rx"); // string; incorrect chmod("/somedir/somefile", 0755); // octal; correct value of mode ?> here /somedir/somefile is your file path and read this article

Categories : PHP

iis permissions and directory access
What you need to do is add a new IIS AppPool identity, not a new system user, and give this new identity full control on the website dir root. (http://technet.microsoft.com/en-us/library/cc731784%28v=ws.10%29.aspx) Open IIS Manager. In the Connections pane, expand the server node and click Application Pools. On the Application Pools page, in the Actions pane, click Add Application Pool. On the Add Application Pool dialog box, type a friendly name for the application pool in the Name box. From the .NET Framework version list, select the version of the .NET Framework required by your managed applications, modules, and handlers. Or select No Managed Code if the applications that you run in this application pool do not require the .NET Framework. From the Managed pipeline mode list, select o

Categories : Asp Net

set file permissions in one directory to match another
It could be easy as using get/setfacl (check the generated file has relative paths): cd dir-a && getfacl -R . > /permissions.acl cd dir-b && setfacl --restore=/permissions.acl

Categories : Python

Add recursive command to set sub directory permissions in C#
First, if your target framework is 4.0, recommend that you use the Directory.EnumerateFiles method (you can also find 3rd code that does the same thing.) Assuming this is a no-go, you can simplify your recursive processing by using the yield keyword, e.g. make a traverse method based on yield -- I'm showing this with a filter function to since it would often be useful in directory traversal ad should give you ideas. static IEnumerable<string> traverse(string path, Func<string, bool> filter) { foreach (string f in Directory.GetFiles(path).Where(filter)) { yield return f; } foreach (string d in Directory.GetDirectories(path)) { foreach (string f in traverse(d, filter)) { yield return f; } } } Then you use tr

Categories : C#

Which directory do I put python modules in?
first, pip install is to be used from command line. then, How to install pip on windows? might help. Just install pip from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip. Then, add the path to your pip executable to your Path env. var. Then, just pip install requests and pip install beautifulsoup4 and it will work. pip just connects to its servers and fetches the package that was registered to the name you requested.

Categories : Python

permissions for the /Library/Ruby/Gems/1.8 directory
Your question lack some basic information, I would say ;) For this kind of problem you should include at least your OS (I guess you are on mac os because of the /Library directory) What the error says is that, as a normal user, you cannot write in the /Library directory, which is a system directory (and as such require administrator privilege). From what I read, there is no root account on mac os by default, but maybe you can use sudo to issue a command with temporary privilege: try sudo gem install bundler and see if it works (it should prompt you from your password). Otherwise, you can certainly install the program locally (in your $HOME), but as I never used mac os I can't really help you here. If the above does not work, I suggest you rephrase your question as "using gem on mac o

Categories : Misc

Chef: Insufficient permissions creating a directory in C:
Per http://tickets.opscode.com/browse/CHEF-3787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel it looks like this is a bug. My resolution to this is to just go the ruby route require 'fileutils' FileUtils.mkdir_p node['app']['unzip_path'] The problem here is that I lose the idempotence property that chef's directory resource provides, but if you need to put stuff into program files, this seems to be the only route for now

Categories : Ruby

How to copy a directory with its attributes/permissions from one location to another?
Answering my own question: /** * Copies a directory. * <p> * NOTE: This method is not thread-safe. * <p> * * @param source * the directory to copy from * @param target * the directory to copy into * @throws IOException * if an I/O error occurs */ private static void copyDirectory(final Path source, final Path target) throws IOException { Files.walkFileTree(source, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new FileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes sourceBasic) throws IOException { Path targetDir = Files.createDirectories(target .resolve(source.

Categories : Java

Python -- import from modules the same directory
You are probably missing __init__.py file in your pylearn2 directory There is some information about directory structure. There is official documentation for modules.

Categories : Python

How to change the current working directory to a specific directory and execute a program under the specific directory?
One of your principal problems is that you don't capture the return value (output) of the command in backticks. You are merely throwing away the output you want. Do something like: my $output = `perl ./script.pl` system("perl ./script.pl")

Categories : Perl

Solr index directory of files add file permissions from database
Yes, if you are on Solr 4+, you can push a Partial Update to Solr index. SCHEMA For partial update, all fields in your schema.xml need to be stored. This is how your fields section should look like in schema.xml: <fields> <field name="id" type="string" indexed="true" stored="true" required="true" /> <field name="title" type="text_general" indexed="true" stored="true"/> <field name="description" type="text_general" indexed="true" stored="true" /> <field name="body" type="text_general" indexed="true" stored="true"/> <field name="permission" type="integer" indexed="true" stored="true" /> </fields> INDEXING: You can first index all documents(directory of pdf and word) to your index. Then you can send a partial update to the permissi

Categories : Wordpress

How to use a Puppet File Resource to give different permissions on a directory than to it's files?
Create a define containing an exec to change the mode of the directory after it is recursed. http://projects.puppetlabs.com/projects/1/wiki/File_Permission_Check_Patterns

Categories : Ruby

How can a directory with wide open permissions throw an EPERM error (hadoop)?
This is the standard Linux behavior. When attempting to chmod, its not the permissions that matter but the user attempting it. The thread at http://unix.stackexchange.com/questions/52519/when-does-chmod-fail answers further on this.

Categories : Hadoop

Linux C read a directory
I found this code here in Stack Overflow (How can I get a list of files in a directory using C or C++?), that helped me a lot in understanding how it works: #include <dirent.h> #include <stdio.h> #include <string.h> int main(){ DIR* dirFile = opendir( "." ); struct dirent* hFile; if ( dirFile ) { while (( hFile = readdir( dirFile )) != NULL ) { if ( !strcmp( hFile->d_name, "." )) continue; if ( !strcmp( hFile->d_name, ".." )) continue; // in linux hidden files all start with '.' if ( gIgnoreHidden && ( hFile->d_name[0] == '.' )) continue; // dirFile.name is the name of the file. Do whatever string comparison // you want here. Something like: if ( strstr( hFile->d_name, ".c" ))

Categories : C

IIS forgets virtual directory permissions - An error occurred loading a configuration file: Failed to start monitoring changes
For anyone else frustrated with the same issue - while I did not find the crux of the problem, I did figure out that this problem was related to the Identity of the Application Pool that the website was running under. In my case, the solution was to change the App Pool identity from the ApplicationPoolIdentity Built-in account to a custom account that is an administrator on all of the machines involved. To do this Right click on the application pool in IIS, Choose Advanced Properties. Under ProcessModel->Identity , choose Identity. Choose Custom Account (Built-in account, Application Pool Identity is the default in IIS 7.5) Switch to using a Custom Domain account, that is an administrator on this machine, as well as the machine where the virtual directory is hosted. Restart the App

Categories : Asp Net

No Such File or Directory Error In Linux
You're getting the error because you're trying to run it as root. Run as user devuser (from within the /home/devuser/Documents/Sublime Text 2 directory) and it should be OK. I think your original error came from the fact that you were trying to run ./sublime_text from within the /etc directory, and it wasn't installed there. The ./ part of your command means "run the file named thus-and-such in the current directory".

Categories : Linux

Linux directory permission inheritance
The way permissions affect paths is explained in the path_resolution man page: http://linux.die.net/man/2/path_resolution The only permission on folder A that matters is the search (execute) permission: if you don't have it you can't descend to folder B. Other than that there is no relation between permissions of A and B, for example if A is read-only and B is not, or even if you don't even have read permission to A, you still can create and delete files in B.

Categories : Linux

No such file or directory error in linux
This line: #!/bin/bash set -o pipefail cd #<----- here! echo Testing node splitting [1/2], should take seconds ../pathwaytab2daifg needs_split_1.pathway.tab needs_split_1.cfg | diff needs_split_1.out - || exit 1 is changing the directory to ~/, which is the default argument of cd if you don't pass a path to it (see here). You could fix the script to work from anywhere if you like, by giving cd an absolute path i.e. changing that cd line to cd /home/hora/Paradigm/testdata.

Categories : Linux

linux/module.h No such file or Directory
You're missing the Linux kernel headers which allow you to compile code against the Linux kernel. To install just the headers in Ubuntu: $ sudo apt-get install linux-headers-$(uname -r) To install the entire Linux kernel source in Ubuntu: $ sudo apt-get install linux-source Note that you should use the kernel headers that match the kernel you are running.

Categories : Linux

Linux zip a directory excluding some internal directories
It's not an error, it's a warning. Archives containing absolute paths to files are a security risk. Imagine an archive containing /etc/passwd. If you insist upon having the absolute paths in the archive, use the -P option: -P, --absolute-names don't strip leading `/'s from file names

Categories : Linux

linux - cannot view directory created from java
This does not work because ~ is expanded by your shell, bash or sh or whatever. This doesn't work from Java. You have created a directory called ~ in your working directory. You need to get the user's home directory from the system property user.home and build your path from that. final File dir = new File(System.getProperty("user.home"), "tempDir");

Categories : Java

retrieve part of Linux directory path
You can directly use System.getEnv(String) method. If you want parts of MY_HOME by going 3 levels up then you can probably do: String logPath = myHome + "/../../../logs"; OR to get first 2 parts of path: String arr[] = myHome.split("/"); String logPath=""; if (arr.length > 2) logPath = arr[0] + '/' + arr[1] + "/logs"; System.out.println(logPath); // mydir/myproject/logs

Categories : Java

PHP script to move a directory from one Linux server to another?
there are many ways to do this but the easiest seems to be to send your cmd with php's exec or passthru function. http://php.net/manual/en/function.exec.php http://www.php.net/manual/en/function.passthru.php Warning When allowing user-supplied data to be passed to this function, use escapeshellarg() or escapeshellcmd() to ensure that users cannot trick the system into executing arbitrary commands.

Categories : PHP

System.IO.Directory.Exists() use with both Windows and Linux
Windows is quite tolerant about this. You can use the forward slash and it will understand. If you don't want to take the chance it might get confused (I'm not 100% sure Windows always understands this), you can use Path.DirectorySeparatorChar

Categories : C#

linux execvp ; ls cannot access |, No such file or directory
ls -l | less is actually a shell command line that consists of two processes connected by a pipe. The execvp() call can only spawn a single process. If you want to do this from your program, you must invoke the shell explicitly - either by using the system() call, or by changing the command line to sh -c 'ls -l | less'. Your word array should look like this: word[0] = "sh" word[1] = "-c" word[2] = "ls -l | less" word[3] = NULL [EDIT] Alternatively, you could do what the shell is doing internally: spawn two processes and connect them with a pipe. This would involve using the fork(), pipe(), dup2() and execve() calls. However, invoking the shell is much less work, and since less is an interactive program anyway, you don't need to worry about performance that much: anything that takes les

Categories : C

x86 linux cr3 register dereference (how can I get to a page directory?)
The contents of the CR3 register are for the CPU, not for the kernel. Software always uses virtual addresses. If you want to access the page tables, you should use the helper macros in <asm/page.h>; for details, see Page Table Management (although it's somewhat outdated).

Categories : Linux

Can I use a valid email address as a linux directory name
No, almost. The '/' character is allowed in emails (http://en.wikipedia.org/wiki/Email_address#Syntax) but not in linux filenames. See SO Answer here: Are there any invalid linux filenames?

Categories : Linux

GTK+-3.0-dev No Such File Or Directory on compile (Linux Mint/gcc)
OK, the guys over at linuxquestions got me straightened out. ` != ' (backtick is not the same as single quote) I should have used backticks instead of the quote, also could have used $() $ gcc simple.c -o simple $(pkg-config --args) I'll go read a manual on the command line... :/ as for the first problem (why pkg-config --libs gtk+-3.0) gave me a "package gtk+3.0 was not found in the pkg-config search path", I think I must have only had libgtk-3-dev installed and not installed gtk+3.0.

Categories : C

Redirect all requests to a directory and it's subdirectories to a file inside the directory, using Apache2 server
Place an .htaccess inside project one folder with the following rule: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase /php/projectone/ RewriteRule ^(view/)?index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . view/index.php [L] And you can repeat that for any other project folders you have. by changing the RewriteBase.

Categories : PHP

Moveuploaded files function in PHP moves the file to the temp directory but not to the destination directory
First time you called move_uploaded_file() you moved that file from temporary folder to $workDir. After that, uploaded file no longer exists in temporary directory. Just use rename() function to move that file from $workDir."/".$tmpName to final destination. // moves file from workdir to final destination rename($workDir."/".$tmpName, $_POST['filetype'].'/'.$rightname);

Categories : PHP

Emacs Auctex compile error: "Use M-x make-directory RET RET to create the directory and its parents"
Sometimes AUCTeX gets confused parsing the log of (La)TeX compilation and isn't able to guess the correct line raising the error. In some cases AUCTeX issues an obscure message "Error occured after last TeX file closed", when there are unbalanced parentheses, in your case it suggests you to create a new directory. To help AUCTeX finding the correct line raising the error you can add the -file-line-error option to latex or pdflatex by customizing the variable LaTeX-command-style. To do this add the following code to your .emacs: (setq LaTeX-command-style '(("" "%(PDF)%(latex) -file-line-error %S%(PDFout)"))) See also the AUCTeX FAQ: 8. Why does TeX-next-error (C-c `) fail? When writing the log file, TeX puts information related to a file, including error messages, between a pa

Categories : Emacs

Makefile: copy perl/python files from source directory into build directory
Basically, when you run make X, you are telling Make to find target X in your Makefile. So if you have no install: target, nothing will happen. All of this really depends what is in your Makefiles. If you want to copy your perl/python files into the build directory, one way to do so is to write a Makefile target that runs a *sh command like mv dir2/*.pyc build; mv dir2/*.pl build, and require that target somewhere else in your Makefile. If you need a good Makefile tutorial, here's one that I started with.

Categories : C++

Django under IIS (with HeliconZoo) in virtual directory - urls resolver works with path without directory name
Finally, I've found what's wrong with it. Appeared that the reason for described behavior is a setting provided with default web.config file: <add name="django.root" value="%APPL_VIRTUAL_PATH%" /> After I removed it everything started working fine. Here is some info related to django.root variable applied to Apache.

Categories : Django

How do I change symfony 2 doctrine mapper to use my custom directory instead of my Entity Directory under the bundle
you can tell Doctrine the directory where is your entities doctrine: orm: auto_generate_proxy_classes: %kernel.debug% auto_mapping: false mappings: name: type: php dir: %kernel.root_dir%/../src/Company/CartoDBBundle/Tests/CartoDB/Entity Here you have the full documentation Doctrine configuration I made a similar question a few days ago, there you can read the full answer Cedar gave me Similar post

Categories : PHP

getting the full filenames from all top directory files in a specific directory and suppressing the occuring error
Did I understand correctly that you only need the File-names with directory-names. This code works for me, no elevations needed. private void button1_Click(object sender, EventArgs e) { string folder = @"C:windowsprefetch"; string filemask = @"*.pf"; string[] filelist = Directory.GetFiles(folder, (filemask)); //now use filelist[i] for any operations. }

Categories : C#

How can I copy only files and folder created in the past hour in one directory to a new directory?
Robocopy doesn't have the granularity, but XXcopy seems to handle it. /DA#30m selects files made within the last 30 minutes. XXcopy is free for non commercial use and can be downloaded from http://www.xxcopy.com XXcopy is xcopy on steroids.

Categories : Batch File

For a Ruby CLI, what is the most reliable way to change directory to users root/home directory?
To summarize Avdi Grimm's screencast on the same subject, If you're using a Ruby version greater than 1.9, the Dir module provides a method #home. However, this depends on the environment variable HOME set on the user's shell session. To reliably get the home dir, you should pass in the login name of the current user to the Dir.home command. Or, in code: # Works if HOME is set in the environment i.e., if "echo $HOME" returns the home directory # when that command is run on the command-line Dir.home # => /Users/<username>, Works if HOME is set # If the HOME environment variable is not set, you should explicitly pass in the username # of the currently logged-in user Dir.home(username) # => /Users/<username> # The current username can be obtained using username

Categories : Ruby



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.