file-access

Access to “Program Files” folder needed

穿精又带淫゛_ 提交于 2019-12-18 07:09:25
问题 I ran into this quite often stated problem but even after looking up nearly every scource I didn’t get an aswer. Problem is as follows: I wrote a little updater tool that connects to a server to check for new versions of an application and then copies the new version to the clientmashine. So the pattern is as follows: Client installs the updater which is pre configured by me with a specific application. So basicly the updater is somewhere in the Program Files Folder. Then the updater is

Java - Access file with user authentication

五迷三道 提交于 2019-12-17 17:03:52
问题 I have a server where I work with a database and files using a java app. When I start my app I give a report regarding file access to the server using: public static boolean folderExists(String folderPath) { File folderToCheck = new File(folderPath); return folderToCheck.exists(); } Every time I start my app (after a fresh restart of my computer) I get a false response, even though the server is on. The reason is because I must give an authentication as another user. What I do is access the

How do I create a file AND any folders, if the folders don't exist?

为君一笑 提交于 2019-12-17 10:24:55
问题 Imagine I wish to create (or overwrite) the following file :- C:\Temp\Bar\Foo\Test.txt Using the File.Create(..) method, this can do it. BUT, if I don't have either one of the following folders (from that example path, above) Temp Bar Foo then I get an DirectoryNotFoundException thrown. So .. given a path, how can we recursively create all the folders necessary to create the file .. for that path? If Temp or Bar folders exists, but Foo doesn't... then that is created also. For simplicity,

How do I lock access to a file when a user has it open?

为君一笑 提交于 2019-12-14 02:07:31
问题 I'm writing a C#.NET program which uses XmlSerializer to serialize and deserialize the project the current user is working on to and from an XML file. This is working fine, but I'm trying to figure out a way to prevent two users from opening the same file off a network drive and having one user overwrite the previous user's save. I essentially want the behavior that MS Word has, where if the program can not gain write access to a file when it is being opened it opens the file in a read only

Chrome, not rendering pdf file without extension

筅森魡賤 提交于 2019-12-13 08:34:59
问题 I have this situation that is little bit hard to explain. I have this url that ends in this format of www..../samplePDF.HTM when I open the url in Internet Explorer, it reads the page as pdf (it doesnt care about the extension of .HTM), however when I open the same url in Chrome it wont render and just show me random symbols, like it cant encrypt it. is there away to have the chrome render the content and recognize the url as a PDF file. I cant change the url to samplePDF.PDF ... but if I

Getting file permissions across the network

帅比萌擦擦* 提交于 2019-12-13 02:57:21
问题 I have a situation where I need to confirm that I am able to get write access to a particular folder on the network. So firstly I check is the user or one of the groups it is part of (domain groups) one of the identities in the access rules. If that is not the case then I need to go through and check all the local groups on the remote machine, to see if my user or one of the user's groups is a member of the local groups on the machine. For example on this particular machine I am a member of

System.IO.IOException error, can't get access to the file

梦想与她 提交于 2019-12-12 14:28:12
问题 I can't understand where problem is, despite the fact, that this code pretty easy. I have such function: public void WriteToDoc(string path) { XDocument doc = new XDocument(new XElement("General parameters", new XElement("num_path", num_path.Text), new XElement("Gen_Peroid", Gen_Peroid.Text), new XElement("Alg_Perioad", Alg_Perioad.Text)) ); doc.Save(path); // here he gives that exception } num_path.Text , Gen_Peroid.Text and Alg_Perioad.Text are string . This is how I use this function: File

UnauthorizedAccessException on creating file after deletion using FileStream

孤街醉人 提交于 2019-12-12 09:24:53
问题 I am facing an issue on client system. On trying to reproduce it in a sample code I have reproduced it. Here's the sample code Imports System.IO Public Class Form1 Private _lock As New Object Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim t As New Threading.Thread(AddressOf createFile) With t .IsBackground = True .Name = Guid.NewGuid.ToString .Start() End With End Sub Private Sub createFile() Dim path As String = "D:\SomeFile

Python get last reading time of a file [duplicate]

旧巷老猫 提交于 2019-12-12 09:19:36
问题 This question already has answers here : Get last access time of the file? (2 answers) Closed 6 years ago . I'm looking for a solution to get the time a file was read at last. The file will be not modified or created just opened in reading mode. This works but only for writing in a file. If I open the file in read mode, the time is not correct: f = open('my_path/test.txt', 'r') f.close() print time.ctime(os.stat('my_path/test.txt').st_mtime) Any hints? 回答1: You are looking at the wrong entry

Is it possible to access files beyond WEB-INF folder in dev mode of GAE (java.security.AccessControlException: access denied)?

人盡茶涼 提交于 2019-12-12 02:52:58
问题 Is it possible to access files beyond WEB-INF folder in Google App Engine's development server ? Maybe I can somehow force GAE dev server to do not block external connections/file access ? I'm trying to create Java version of gae-sqlite. But I can't access external sql server (mysql or h2db) due to access denied exceptions. Call stack: Caused by: java.security.AccessControlException: access denied (java.io.FilePermission C:\work\test_projects\gae_test\out\artifacts\gae_test_war_exploded