On Fri, 30 Dec 2005, Daniel Albuschat wrote:

> 2005/12/30, Aaron Gyes <[EMAIL PROTECTED]>:
> > On Sun, 2005-11-20 at 11:55 -0500, Alan Stern wrote:
> > >       echo -n 3 >/sys/block/sdb/device/../../../power/state
> > >       echo -n 3 >/sys/block/sdb/device/../../../../power/state
> >
> > Sorry about my terrible lag. Things came up and I forgot all about this.
> > I can't figure out which power/state file you want me to attack. What do
> > the /../'s represent? taken literally (parent) they put me
> > outside /sys/.
> 
> device is a symbolic link. The actual state file can simply be accessed with
> /sys/block/sdb/device/power/state

Right about the symbolic link, but wrong about the actual state file.

For example, right now I have a USB flash storage device on my computer, 
as /dev/sda.  ls tells me this:

$ ls -l /sys/block/sda/device
lrwxrwxrwx  1 root root 0 Dec 30 12:20 /sys/block/sda/device -> 
../../devices/pci0000:00/0000:00:0f.3/usb1/1-4/1-4:1.0/host0/target0:0:0/0:0:0:0/

In other words, /sys/block/sda/device is a symbolic link to 
/sys/devices/pci0000:00/0000:00:0f.3/usb1/1-4/1-4:1.0/host0/target0:0:0/0:0:0:0

Hence /sys/block/sda/device/../../../power/state actually refers to 
/sys/devices/pci0000:00/0000:00:0f.3/usb1/1-4/1-4:1.0/power/state which 
obviously is not the same as /sys/block/sdb/device/power/state.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to