You are here

Locked folders on mac

14 posts / 0 new
Last post
camd54321
Offline
Last seen: 16 years 7 months ago
Joined: 2007-11-18 20:41
Locked folders on mac

I do know that portable apps does not run on a mac!
That being said when I did plug my thumb drive in my mac for copying some files into the music folder under documents (I keep music on my mac) I was upset when I could not copy it in. The folder for documents and all the folders within were locked.

Normally you can unlock a folder or file fairly simply by un-checking a checkbox, this would not work for this. These folders I found were locked in a way that only that they are only system immutable. So to get rid of it I had to boot up into single user mode and fix it using command line.

Anyways my point is that there is no reason for these folders to be locked and in the next suite they should be unlocked.

Simeon
Simeon's picture
Offline
Last seen: 9 years 10 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
I have a similar think on linux

I cant copy stuff into the portableApps and the documents folders but I can copy stuff into their subfolders...weired...:puzzled:

Does anyone know anything about it???

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Caehan
Caehan's picture
Offline
Last seen: 1 year 6 months ago
Joined: 2007-10-19 22:51
Hmmm...

On some Linux distro's thumb drives are considered as root. This makes it where you cannot edit the files, and sometimes where you cannot add files. I have no idea if this is the case with Mac [I have never used one, yet].

Simeon
Simeon's picture
Offline
Last seen: 9 years 10 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
I know

but I guess thats not the case as I can copy files over to the drive just not to some folders...

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Caehan
Caehan's picture
Offline
Last seen: 1 year 6 months ago
Joined: 2007-10-19 22:51
.

I have no idea then.

camd54321
Offline
Last seen: 16 years 7 months ago
Joined: 2007-11-18 20:41
It would be the same on linux

That makes sense that it would have the same problem on linux, the locking on these folders is on the very base level on which darwin (the mac os x kernel) and the linux kernel are similar in some ways. If anybody wants me to I can post a guide on how to get rid of it which will work on os x and probably on any linux distro.

rab040ma
Offline
Last seen: 2 months 1 week ago
Joined: 2007-08-27 13:35
It might be better to

It might be better to research whether there is a way to replicate the problem consistently. Does it happen to all folders created when you add PortableApps to a USB drive, or just that one, or just all folders in the "root" of the drive?

On Linux the rule that tells the operating system how to mount a USB drive is kept in a place like /etc/fstab. Does the Mac have something similar? If that instruction tells the operating system to make it write-only, or be owned and writable only by the superuser/administrator, that would cause the problem you describe. Maybe there is some change that can be made to those settings.

If it is not something that PortableApps is doing wrong, but rather something intrinsic with the way the FAT32 filesystem is being read by the Mac, maybe you can figure out what change (if any) the "launch into single user mode" or other fix actually does. If there is some sort of information being written to the USB drive to make it writable, maybe the PA installer can make the same change when it installs (or avoid writing some data that locks it).

MC

camd54321
Offline
Last seen: 16 years 7 months ago
Joined: 2007-11-18 20:41
As far as I can tell the

As far as I can tell the only way this would have happened would be if someone who worked on the project changed the folder properties on a mac (or linux machine) to be locked this way. It is possible there is some conflicting file properties which mean some thing else on a PC, but I really doubt it. I can create new folders and they do not get locked when I create them on my mac or PC.

The actual permissions on the flash drive don't seem to be the problem. The problem doesn't actually seem to be at all with the flash drive but just two folders created by the portable app installer and there sub-directories. Those 2 folders (Documents and ) on those two folders the ownership and permissions don't show up as the problem, and they are just read only. I believe how files or folders in mac os x are locked is similar to linux and goes something like this: a simple lock which can be unlocked just my clicking the lock, and a user immutable locking which can be locked by any user and unlocked by the root user, also a system immutable lock which can be locked by the root user and unlocked only by booting into single user mode.

The two portable app folders are the system immutable type. I think that is how the locking is set up but I am not really 100% sure. I think that although it might be organized similarly in linux the actual commands for locking and unlocking are different. In os x the verb is chflags but I could not find any reference to that online for linux.

I am really over my head in allot of this, I am very new to unix commands.
Anyways just incase anybody wants to know how to do get rid of it here we go.

First of all you must know how to mount your flash drive in single user mode (google around, I don't remember how I got it to work)

You will need to use a computer with os x installed on it (Not sure which versions will work, but 10.5 i know works and .3 and .4 should)

First plug in your flash drive and shut down your computer. Now hold apple - s and press the power key. When the screen turns black and you see some text appear you know that you are in single user mode.

** BE VERY CAREFUL WHAT YOU TYPE, typing in the wrong things could cause un-fixable damage to your computer and its files**

Now mount your flash drive

now type :
cd /VOLUMES/[your flash drives name*]
*use quotes if you flash drive has a space in its name

now to unlock the folder you must use "chflags"
so chflags -R noschg Documents
What each part does is chflags is the basic verb. The -R tells it to not only unlock this folder but all the folders and files within. noschg means remove the schg flag. Documents is the folder which you are unlocking.

Now the folders are unlocked, you can press the power button and reboot your computer back into mac os x. You may have to select each folder and do get info and uncheck the locked check mark.

If you have any questions, it did not work, or have no clue what I talking about just reply and say so.

The portable app installer defiantly does not need to write this information. My only guess on how this happened would be that the person who made the installer thought it would be a good idea to lock the folders so he locked the folders and then put them into the installer.

rab040ma
Offline
Last seen: 2 months 1 week ago
Joined: 2007-08-27 13:35
As Jimbo mentions

Thanks.

As Jimbo mentions, Microsoft uses the read-only flag on the directory to tell the OS to look for customization, whereas the Mac uses it to make the directory read-only.

Here are two little command files you can create with Notepad on your USB drive to run under Windows to clear the read-only attribute. If you create these as two files with a name that ends with .cmd or .bat, and save them to the USB drive, you can click on the first from Windows Explorer to make those folders accessible on the Mac, and the second later to put things back the way they were (if that is desired).

REM name something like ClearReadOnly.cmd

REM  removes read-only flag on directories
REM  and makes the directories usable under OS X

attrib -r \Documents
attrib -r \Documents\Music
attrib -r \Documents\Pictures
attrib -r \Documents\videos

REM name something like SetReadOnly.cmd

REM   restores the read-only attribute of directories
REM   so their icons are again visible

attrib +r \Documents
attrib +r \Documents\Music
attrib +r \Documents\Pictures
attrib +r \Documents\videos

I offer them as an alternative to either opening a command prompt on Windows or booting into single user mode on the Mac. Of course they have to be run on the Windows machine.

edit: It looks like the \PortableApps folder has the same feature, as may other folders. You could add the corresponding line to each command file, if you need to change something under \PortableApps. That might not be a good idea, but the option is there.

MC

Jimbo
Offline
Last seen: 4 years 7 months ago
Joined: 2007-12-17 05:43
It is caused by the READ-ONLY attribute on the folder

This is an evil little problem.

Windows basically ingores the read-only flag for folders, and instead uses it to mark that there is a desktop.ini file in that folder that needs to be read and processed.

Because of this, when you install PA, it sets read-only on the special folders - the ones that it wants to put icons on.

Sadly, Unix and unix-like systems (OSX, Linux) also use the FAT attributes such as read-only, but they map them a little differently, such as to immutable.

To clear it up, on a windows box, use the command
attrib -r <foldername>
and you will be able to work with the folder just fine, but the icon will vanish in explorer.

To get the icon back, use
attrib +r <foldername>
but you'll have trouble on non-windows systems again.

For more info, see http://support.microsoft.com/kb/326549 which talks about this from the windows perspective.

dirtydan
Offline
Last seen: 1 year 4 months ago
Joined: 2007-11-26 17:13
FAT 32 Directory Read-only attribute

I have one tiny detail to add to this. From my old DOS days setting the Read-only attribute had one other side effect. The only side effect in those days. You could not delete a directory that had it set. You could do anything in it you wanted to, but you could not delete or rename it.

I would think for us Mac users the side effect of losing the folder icon would be small compared to the aggravation of having to do weird stuff when we are at home, on our Macs.

So, as long as you are not likely to delete any of the folders in question, turn this attribute off.

Also, I would bet that another way exists that will allow the assigning of folder icons under windows.

Bruce Pascoe
Offline
Last seen: 12 years 8 months ago
Joined: 2006-01-15 16:14
...

The funny thing is that the Read-Only attribute isn't even required. The System attribute is sufficient to tell Windows that the folder is customized. Just as long as you only set the System attribute and not the Hidden one, the directory will still show up in Explorer, custom icon and all.

Not sure what Linux does with the System attribute, though...

dirtydan
Offline
Last seen: 1 year 4 months ago
Joined: 2007-11-26 17:13
...

Thank you Bruce.

Using a windows box today I found this to be true.

The above mentioned instructions are slightly in error (for WinXP at least), but only slightly. To clarify for anyone interested what I did was found the drive letter assigned to my usb drive (x:) for this tutorial. Yours will undoubtedly be different.

Then I opened a command window:
Start -> Run -> cmd

Then I typed the following commands, the order is not important, but the syntax is. Be sure to press enter at the end of each line.

x:
attrib -r+s /d /s \Documents
attrib -r+s /d /s \Documents\Music
attrib -r+s /d /s \Documents\Pictures
attrib -r+s /d /s \Documents\videos

breakdown:
Secret changes the default directory from whatever it was to the root directory of drive x:, remember to substitute you letter for x and you must have the colon with no spaces or anything else on the line.
The attrib command uses the -r to remove the read-only and the +s to set system which, thanks to Bruce, makes the folder icons show in Windows Explorer. The /d and /s flags are needed so that attrib will properly handle directories.

Now I can cut, copy, and paste to and from these folders on my Mac and I am a happy camper and life is good again.

Cheers.

Bruce Pascoe
Offline
Last seen: 12 years 8 months ago
Joined: 2006-01-15 16:14
attrib /d /s?

attrib /d is sufficient. Combining the two switches (/d and /s means apply the specified attributes not only to the directory, but any directories--and files!--under it. I think you'll find that every single file under \Documents now has the system attribute! Shouldn't cause any problems, just letting you know that was overkill.

Actually /d isn't even necessary, come to think of it. That switch is only needed when using wildcards. Which means the above sequence can be changed to:

x:
attrib -r+s \Documents
attrib -r+s \Documents\Music
attrib -r+s \Documents\Pictures
attrib -r+s \Documents\Videos

Log in or register to post comments