How to set permission for Folder in Blackberry ? - blackberry

I want to know how to set permission for folder that is created by my app so no one can delete or see that folder.

I think this is not 100% possible, however you may do smth in this direction. Check for FileConnection.setHidden(boolean), FileConnection.setWritable(boolean) and FileConnection.setReadable(boolean).
First of all, the API docs are vague as to whether those methods will have any effect at all on a specific device (meaning a file system).
Secondly, even if you use FileConnection.setHidden(boolean), then it is still possible for another app to "see" your file/dir by using FileConnection.list(String filter, boolean includeHidden). Once one has a path of you hidden dir, he/she can change the hidden attr (and other attrs), so it becomes visible/readable/killable.

Related

Where do I find a relative path?

I am trying to figure these out, but every single thing I read says exactly what I've already read in a previous article. I understand it theoretically, but I have no idea what how to write it into a code. I am such a noob and I need lots of help!
A relative path is the location of the file/folder relative to where you are. The absolute path is the full location. For example:
"C:\Product\Folder\SubFolder\file.exe" might be the absolute path of a file on your machine. But if you're already in C:\Product the relative path to that file would just be "Folder\SubFolder\file.exe". It's like knowing someone's full mailing address or knowing how to get to their house from yours. You may not need to know where you are in the world to know how to get from one place to another (your house to a coffee shop for example).
In code, you would use the absolute path if you're explicitly looking for a file at this location. But you may not always know the absolute location where your app is executing, and you are trying to access files that you control. In this case you only need to know how to get there based on where you are.
For example, My app may be installed at the following absolute paths "C:\Company\Product\app.exe" and my have had a library of files installed under that in the folder "C:\Company\Product\Files\". The absolute path may change if the user decides to install it in another location. But you still control the "Files" folder, so you would code the relative path of "Files\file.txt" to access it.
If you're still struggling with the difference. Think of the absolute path like the postal address of a chain store. Where every instance of that store is identical. The absolute path is the location of an item in a specific instance of that store (location of the store + location of item within the store). The relative path is just the location in the store. If the store were your app, or you were in a store, you don't really care where you are (which instance of the store you're in). You just need to know where the item is in the store. Relative path is knowing an item is in Row 2, second shelf from the bottom, third from the right. To you, it doesn't matter which store your in, you can still find it.

In PHPstorm , is any way to avoid save all open documents instead current active document? [duplicate]

My traditional workflow must be a little different to the PHPStorm default. I often work on multiple files at the same time and want to be able to save just one file when I've finished with it, without saving the others that I've modified.
I've managed to turn off the auto-save feature. Now, when I edit files I get stars on the ones I've edited and they stay like that until I hit 'save'. So far so good.
But when press CTRL-S to save, expecting it to save the one file I'm looking at so I can go back to the ones with asterisks to polish them off too, it also saves ALL the other files too.
I hope there's some way to change this behaviour or set up something to allow me to save just one file at a time!
Yes, you can .. but that still does not change a lot (e.g if you change your settings, or run/re-run something -- all files will be saved automatically anyway). Eventually (after few weeks or month of adaptation) you will get used to this behaviour and quite likely will love it (yes, this means changing working habits a bit, which is quite hard to do (requires time) for some people/in some cases).
Anyway ... to enable "save single file" functionality:
Settings | Keymap
On that screen, in search box type "save"
The action you are after is called "Other | Save Document"
Assign whatever shortcut you want.
P.S.
This action will NOT ask for confirmation (same behaviour as standard save does).
P.P.S.
This action is available since PhpStorm v7 ONLY.

Where does Electron save previous zoom?

Electron appears to remember what the zoom factor when restarting the app - where is this saved? I want to be able to reset this.
Thanks!
The zoom factor information for each browser window is memorized in a JSON file named Preferences located in the user data directory accessible through app.getPath ('userData');
If the zoom factor is different from its default value 1.0, it will be listed at the end of the JSON file (after the DevTools settings), associated with the window's URL. You may find the whole relevant syntax quite odd though...
As a user said, you must find Preferences file in C:\Users\<<username>>\AppData\Roaming\<<package name>>. I tried to change zoom value firstly but it didn't work. After I tried to change per_host_zoom_levels to 0 and it works.
So if you want to manipulate zoom from saved file, you must change per_host_zoom_levels.
I'm not sure about this, but could be in:
C:\Users\**<name>**\AppData\Local\Temp
and then in a folder relative of the name of the app.
The file structure should be C:\Users\%YOUR-USER%\AppData\Roaming\%YOUR-APP%\, edit the Preferences file with an editor (I used notepad), look for {per_host_zoom_levels": {"%SOME-NUMBER%":{%HERE%}}}. At the %HERE% part will have the zoom preference, delete the contents to reset and so that {per_host_zoom_levels": {"%SOME-NUMBER%":{}}} remains. Can augment to have different values as well. Hope it helps for future readers!

Dropbox iOS SDK "Broken"?```

I am trying to use the latest official version of the DropBox iOS Core SDK, in particular the DBRestClient, to efficiently keep a document tree up to date on my local computer. However, several features of the SDK don't seem to be implemented as you'd expect, and I was wondering whether I am doing something wrong, failing to understand something, or on the other hand just looking for features that aren't there.
Dropbox has (at least?) two kinds of entities it stores: files and folders. If I make a change to a file in Dropbox, I can detect it by a change in the file's "rev" string.
However, for folders, the rev string doesn't change when the contents changes. For example, it doesn't change in response to any of the following:
Adding a file
Deleting a file
Editing a file
Question 1:
Is this the expected behavior ? If so, does that mean that when I want to know if any of my Dropbox files have changed I must walk through the entire folder tree every time ?
Deltas:
There is a command to get a "delta" of the current contents (of something, the command takes no path parameters) related a "cursor" string. The command looks like it is supposed to return a record of edited files/folders along with a new "cursor" string specifying the current state. However, when I get the delta, the contents are always empty. If I make a change in dropbox, and then send back the previous returned "cursor", I still get an empty delta.
Question 2:
Are deltas currently working in the SDK, and if so can anyone tell me what I am doing wrong ?
Question 1: Yes, that's the expected behavior. Typically you would use delta to watch for changes.
Question 2: Yes, I would assume that delta is working. You haven't shown any code, so it's impossible to guess what's going wrong.

RoR: Get file (attachment) name/location

In my app I want users to be able to associate a file(s) they have on their desktop/DropBox with a specific item, but I don't want/need them to be able to actually attach the file...I just want to get the file name and location and save that in my database. Then when I display the item I'll hyperlink to the location captured. Can someone point me to an example(s) of how to accomplish this? I looked at the JQuery File Upload (http://blueimp.github.com/jQuery-File-Upload/) but as I mentioned don't actually need to upload the file...so this should be something super easy.
Thanks for your time and assistance.
You can try and get value of file input, but you'll fail.
See this jsfiddle.
All I'm getting is the fake path
C:\fakepath\134.png
And there's certainly no C:\ drive on Mac OSX. :)
I guess, this is because of security restrictions. You shouldn't know (or care) about user's filesystem in a web app.

Resources