After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 104840 - gnomevfssrc seekable property
gnomevfssrc seekable property
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other Linux
: Low enhancement
: 0.7.x
Assigned To: Colin Walters
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-01-30 18:41 UTC by Jorn Baayen
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jorn Baayen 2003-01-30 18:41:58 UTC
It would be great if the gnomevfssrc plugin could have some way of
discovering whether the currently opened stream is seekable.
Comment 1 Wim Taymans 2003-04-04 19:41:55 UTC
Any ideas how the gnomevfs API exposes the seekable property, I can't
find a method. Opening the file with OPEN_RANDOM causes gnomevfs to
open the stream without an error but then it continues to read random
memory...

Comment 2 Christian Fredrik Kalager Schaller 2003-04-23 11:53:09 UTC
Got the follwoing reply from Alexander Larsson when asking about this
on gnome-vfs list:

Hmmm. This sounds strange. gnome_vfs_seek() should return 
GNOME_VFS_ERROR_NOT_SUPPORTED if you seek on a handle where its not 
supported. For local file-uris I don't see how it can read random
memory, gnome_vfs_seek() just calls lseek().

However, there is no "seekable" property you can read. Is there even a 
posix API we could use to implement this?
Comment 3 Wim Taymans 2003-04-26 14:28:42 UTC
lseek returns -1 when an error occured, you can check errno to find
out that it was a pipe/socket or fifo (ESPIPE) you were seeking on; I
would suggest to return _NOT_SUPPORTED in that case.
Comment 4 Alexander Larsson 2003-04-28 08:33:55 UTC
Let me quote the code (which has been this way since a long time):

	if (LSEEK (file_handle->fd, offset, lseek_whence) == -1) {
		if (errno == ESPIPE)
			return GNOME_VFS_ERROR_NOT_SUPPORTED;
		else
			return gnome_vfs_result_from_errno ();
	}

	return GNOME_VFS_OK;

Is this not working?
Comment 5 David Schleef 2003-07-29 07:18:19 UTC
alex: it appears to work fine.  I'm using _seek(,CURRENT,0) for the
test, which should be a no-op, but hopefully it won't be "optimized"
in the future.

Latest check-in adds a read-only boolean parameter called "seekable".