file-permissions

How can I allow the TTS to write files to my app's directories?

会有一股神秘感。 提交于 2019-12-30 11:00:24
问题 I want to write output from the TextToSpeech engine to my app's cache directory. In order to for the TTS to write there I first have to give it permissions to do so. But I don't know how. I understand that normally such problems can be solved by handing a FileDescriptor over thus giving permissions to access a specific file. But I can't do that with TTS, as the TextToSpeech.synthesizeToFile method only accepts the file path as a String, no FileDescriptor . So what to do? To make my point that

How do I change file permission to a certain file pattern to sub folders of my current directory?

断了今生、忘了曾经 提交于 2019-12-29 11:35:09
问题 Using chmod , I do chmod +x *.sh in the current directory but what if I want to change all files including files within subfolders that has an sh file extension?. chmod +x -R * will work but I need something more like chmod +x -R *.sh 回答1: use find: find . -name "*.sh" -exec chmod +x {} \; 回答2: Try using the glorious combination of find with xargs. find . -iname \*.sh -print0 | xargs -r0 chmod +x The . is the directory to start in, in this case the working directory. 回答3: With modern versions

How to get File Permission Mode programmatically in Java

你离开我真会死。 提交于 2019-12-29 08:51:29
问题 I know it is possible to change the permission mode of a file using: Runtime.getRuntime().exec( "chmod 777 myfile" ); . This example sets the permission bits to 777 . Is it possible to set the permission bits to 777 programmatically using Java? Can this be done to every file? 回答1: Using chmod in Android Java doesn't have native support for platform dependent operations like chmod. However, Android provides utilities for some of these operations via android.os.FileUtils. The FileUtils class is

Amazon S3 File Permissions, Access Denied when copied from another account

久未见 提交于 2019-12-29 05:07:10
问题 I have a set of video files that were copied from one AWS Bucket from another account to my account in my own bucket. I'm running into a problem now with all of the files where i am receiving Access Denied errors when I try to make all of the files public. Specifically, I login to my AWS account, go into S3, drill down through the folder structures to locate one of the videos files. When I look at this specificfile, the permissions tab on the files does not show any permissions assigned to

How to modify file access control in .NET Core

孤街醉人 提交于 2019-12-28 16:45:10
问题 I'm trying to change the permissions of a file in .NET Core. However, it seems that FileInfo doesn't have any SetAccessControl anymore. // Create a new FileInfo object. FileInfo fInfo = new FileInfo(FileName); // Get a FileSecurity object that represents the // current security settings. FileSecurity fSecurity = fInfo.GetAccessControl(); // Add the FileSystemAccessRule to the security settings. fSecurity.AddAccessRule(new FileSystemAccessRule(Account, Rights, ControlType)); // Set the new

File exists and IS directory, but listFiles() returns null

半腔热情 提交于 2019-12-28 11:42:26
问题 The documentation for File.listFiles() suggests that null will ONLY be returned in the case that the file calling it is not a directory. I have the following: String dir = "/storage/emulated/0"; File f = new File(dir); Log.v("Files",f.exists()+""); Log.v("Files",f.isDirectory()+""); Log.v("Files",f.listFiles()+""); The log reads: true true null For some reason, listFiles( ) is returning null even though the File is recognized as a valid directory. I'm not super familiar with Android file

Mercurial: Ignore file permission / mode (chmod) changes

一曲冷凌霜 提交于 2019-12-28 06:46:10
问题 Is there a way to ignore file permission / mode (chmod) changes for a Mercurial repository? I'm looking for a setting similar to Git's: core.filemode -> false as described here: Can I make git diff ignore permission changes Update: the correct answer is Ry4an's together with my second comment to his answer. 回答1: Mercurial only tracks the execute permission on files and not in a user/group/other way, just as a single bit, so depending what you're trying to squelch it's possible you really need

shutil.rmtree fails on Windows with 'Access is denied' [duplicate]

半腔热情 提交于 2019-12-28 02:26:06
问题 This question already has answers here : Deleting directory in Python (6 answers) Closed 5 months ago . In Python, when running shutil.rmtree over a folder that contains a read-only file, the following exception is printed: File "C:\Python26\lib\shutil.py", line 216, in rmtree rmtree(fullname, ignore_errors, onerror) File "C:\Python26\lib\shutil.py", line 216, in rmtree rmtree(fullname, ignore_errors, onerror) File "C:\Python26\lib\shutil.py", line 216, in rmtree rmtree(fullname, ignore

How to change default permission for uploaded files in apache with mounted webroot?

你离开我真会死。 提交于 2019-12-25 08:28:09
问题 I have an ubuntu server 11.10 with apache 2.2.20, php 5.3.6 and an installation of Joomla cms. I have used an extra hard disk as my web server storage and mounted it into /data/www/ (I hope it's not where my problem us!). I've set permission of all files and folders in my web root to 755 and user groups for them is set to [default ubuntu user(in my case radio)]:www-data. In past days I had serious problems with joomla not showing new uploaded images and other files and also I can't install

Laravel: Cannot generate migration file with make:migration command

雨燕双飞 提交于 2019-12-25 07:59:04
问题 I've got an ongoing project and migrations were working fine. But I don't know if something has changed, now php artisan make:migration my_migration_name is not generating a migration file and not showing any errors as well. I've tried running it with -v verbosity flag but nothing is printed on terminal. My directory permissions seem to be fine; I've also tried running it with sudo but I got this error message; I've updated composer and tried to remove laravel and reinstall laravel/framework