file-access

Android 10: What are my options to save files on external storage into a directory called “/sdcard/my-app/”

旧巷老猫 提交于 2020-07-31 07:28:52
问题 Up until Android Pie I always stored files which the app needed to get stored on /sdcard/my-app/ , which I got via File fBaseDir = new File(Environment.getExternalStorageDirectory(), "my-app"); One of my App stores hundreds (up to multiple thousands) of favicons in /sdcard/my-app/favicons , and when the user creates a backup of the app, it gets stored in /sdcard/my-app/backups . Webpage-Screenshots taken by Google Chrome when shared with my app are stored in /sdcard/my-app/screenshots , and

Specification of file descriptors

我的梦境 提交于 2020-06-09 05:19:04
问题 I am trying to understand flags and modes of file descriptors. The man page for fcntl - manipulate file descriptor int fcntl(int fd, int cmd); states: File descriptor flags The following commands manipulate the flags associated with a file descriptor. Currently, only one such flag is defined: FD_CLOEXEC,... File status flags Each open file description has certain associated status flags, initialized by open(2)... The file status flags and their semantics are described in open(2). Given that

Specification of file descriptors

主宰稳场 提交于 2020-06-09 05:17:46
问题 I am trying to understand flags and modes of file descriptors. The man page for fcntl - manipulate file descriptor int fcntl(int fd, int cmd); states: File descriptor flags The following commands manipulate the flags associated with a file descriptor. Currently, only one such flag is defined: FD_CLOEXEC,... File status flags Each open file description has certain associated status flags, initialized by open(2)... The file status flags and their semantics are described in open(2). Given that

How to get the mode of a file descriptor?

送分小仙女□ 提交于 2020-06-07 06:50:47
问题 I mean to use fdopen FILE *fdopen(int fd, const char *mode); In man pages, it is stated that "The mode of the stream (one of the values "r", "r+", "w", "w+", "a", "a+") must be compatible with the mode of the file descriptor." So I have to first know the mode of fd (which I guess is an int ) to choose an appropriate const char *mode for the stream. I understand I should use fcntl int fcntl(int fd, int cmd); to "manipulate file descriptor" (in the following, I quote from this official source).

MacOS sandboxed application: access files without NSOpenPanel

夙愿已清 提交于 2020-05-14 04:02:30
问题 In a sandboxed NSDocument-based application, any compatible document can be accessed using the NSOpenPanel, no matter where the document is saved. Without NSOpenPanel, the application can only access files in the sandbox container. As my application manages two types of subclassed NSdocument (Text as a reader/writer and Image as a reader only), I try to implement a separate "Open Recent" menu for images. I disabled the the ordinary behaviour for them as they are opened by the user, overriding

System.UnauthorizedAccessException was unhandled

a 夏天 提交于 2020-01-30 06:33:06
问题 I am getting a access denied exception. How can I fix this? Here is the exception: System.UnauthorizedAccessException was unhandled HResult=-2147024891 Message=Access to the path 'c:\message.txt' is denied. Source=mscorlib Here is the code: public static void WriteToFile(string s) { fs = new FileStream("c:\\message.txt", FileMode.Append, FileAccess.Write); sw = new StreamWriter(fs); sw.WriteLine(s); sw.Flush(); sw.Close(); fs.Close(); } EDIT: It works if I run vs2012 as administrator, but is

Android Q : java.io.FileNotFoundException: /proc/self/net/dev: open failed: EACCES (Permission denied)

自闭症网瘾萝莉.ら 提交于 2020-01-23 07:49:22
问题 I want to open the file "/proc/self/net/dev" with a FileReader. In the Android 10 there comes a java.io.FileNotFoundException: /proc/self/net/dev: open failed: EACCES (Permission denied) In older versions it's no problem to open this file. What can I do? 回答1: As per Android developer document, they have make change for Android Q scope storage. If your app is targeting Android Q, you should define android:requestLegacyExternalStorage="true" in manifest file <manifest ... > <!-- This attribute

how can i access a file/folder over network through XP_CMDSHELL in sql server 2008?

一个人想着一个人 提交于 2020-01-14 22:54:33
问题 I am trying to access a folder/directory using 'EXEC MASTER..XP_CMDSHELL' it works for the local file/folder, how ever it can not access the folder over network. EXEC MASTER..XP_CMDSHELL 'c:\Images' --Works fine EXEC MASTER..XP_CMDSHELL '\\IPaddress\Images' -- returns "Access is denied." Please note that i can access the network location but not using sql server. Sql server is running under Winodws Authentication mode. Sql server is using 'nt authority\network service' account to access the

Chrome load local resource

时光毁灭记忆、已成空白 提交于 2020-01-14 03:07:48
问题 I want to use a local JS file for development reasons but run into "Not allowed to load local resource"-error in chrome (Version 41.0.2272.89). I read a lot of threads, but this: "C:\PathTo\Chrome.exe" --allow-file-access-from-files does not work for me on my testpage https://jsfiddle.net/sreL1nge/, even that chrome://version says: "C:\Program Files (x86)\Google\Chrome\Application\Chrome.exe" --allow-file-access-from-files --flag-switches-begin --flag-switches-end Can someone try wether it