Questions tagged [file-access]

Questions about programmatically accessing individual files. For questions about accessing a file system, use [filesystem-access]. Use either of these in conjunction with the applicable tag such as [contention], [security] or [capacity] to indicate the focus of the question.

Questions about programmatically accessing individual files. For questions about accessing a file system, use . Use either of these in conjunction with the applicable tag such as , or to indicate the focus of the question.

510 questions
12
votes
1 answer

Assigning file access rights to IIS_IUSRS using PowerShell

I'm trying to add access rights for the user group IIS_IUSRS to a folder using PowerShell. Currently I have $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("BUILTIN\IIS_IUSRS", "FullControl", "Allow") $acl = Get-ACL…
awj
  • 7,482
  • 10
  • 66
  • 120
12
votes
11 answers

Go lang access denied

I'm new to the GO programming language, what I'm trying to do is to put some items into the map and then remove one of them, when I'm trying to remove one of the items from array I'm getting the error message: C:/Go\bin\go.exe run…
TheName
  • 697
  • 1
  • 7
  • 18
12
votes
3 answers

How to to make a file private by securing the url that only authenticated users can see

I was wondering if there is a way to secure an image or a file to be hidden when it is not authenticated. Suppose there is an image in my website which can only be seen if that user is authenticated. But the thing is I can copy the url or open the…
Robin
  • 5,366
  • 17
  • 57
  • 87
12
votes
5 answers

How to intercept the access to a file in a .NET Program

I need to intercept when the system tries to access to a file, and do something before it happens.
FBSC
  • 191
  • 2
  • 9
11
votes
4 answers

FileStream.close() does not free file for other processes

I have Following Code in a Page_Load called function. When the Page is loaded the first time after starting Visual Studio, everything works out fine. But any other opening call to the File after that returns IOException: "File is in use by another…
Vogel612
  • 5,620
  • 5
  • 48
  • 73
10
votes
7 answers

UnauthorizedAccessException on newly created files

I have an application that is looking through some files for old data. In order to make sure we don't corrupt good projects, I'm copying the files to a temporary location. Some of the directories I'm checking are source-code directories, and they…
Jerry
  • 4,507
  • 9
  • 50
  • 79
10
votes
1 answer

System.ComponentModel.Win32Exception when starting process - file not found, but file exists

I am trying to create a manager for my autostarts. It should read an XML file and then start my programs with a custom delay. For example: Realtek Audio Manager C:\Program…
pascalhein
  • 5,700
  • 4
  • 31
  • 44
10
votes
2 answers

How do I restrict access to files with specific extensions in ASP.NET?

I have in my web application an ADO.NET Entity-Framework *.edmx file. When I browse in the browser (when the application is running) to an edmx file, it doesn't show the error page like when browsing to a *.cs or vb file, it opens the edmx and shows…
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
8
votes
1 answer

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

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…
Bafoeg
  • 91
  • 1
  • 3
8
votes
1 answer

How does the code example in the python os module documentation create a security hole?

The documentation for the os module makes the following assertion: Note Using access() to check if a user is authorized to e.g. open a file before actually doing so using open() creates a security hole, because the user might exploit the short time…
K. Nielson
  • 191
  • 9
8
votes
2 answers

How to read a file which is currently used, like Windows does when copying it?

One of my applications is intended to read (and only read) files which may be in use. But, when reading a file which is already opened in, for example, Microsoft Word, this application throws a System.IO.IOException: The process cannot access the…
Arseni Mourzenko
  • 50,338
  • 35
  • 112
  • 199
8
votes
3 answers

File is used by another process. How to know which process?

I keep getting that exception in my program. How do I know which process locked it, either by program code or by doing something with windows? System.IO.IOException : The process cannot access the file 'file.ext' because it is being used by another…
Louis Rhys
  • 34,517
  • 56
  • 153
  • 221
7
votes
3 answers

Fastest way to read large file(>8GB) and dump data into dictionary and load it again

I am dealing with a large protein sequence (fasta) file (>8GB) and my idea is to create dictionary where key and value will be protein id and sequence respectively. As for now I am OK to make and dump data into a dictionary using pickle and then…
Paul85
  • 647
  • 1
  • 11
  • 27
7
votes
3 answers

File.WriteAllText throws UnauthorizedAccessException

Doing File.WriteAllText to a remote path throws UnauthorizedAccessException. When I open the file in notepad I can edit it without a problem. The process that's trying to modify the file is running as my own user account, so it should be able to…
ripper234
  • 222,824
  • 274
  • 634
  • 905
6
votes
3 answers

View Image file without locking it. (Copy to memory?)

I want to be able to open/view a image (.jpg) without locking the file. Basically I have a program that lets the user choose a picture that will overwrite a picture. But the problem is that I display the image that is being overwritten. So how do…
Usta
  • 271
  • 5
  • 14
1
2
3
33 34