switch (image->blob->type)
{
case UndefinedStream:
+ case StandardStream:
break;
case FileStream:
- case StandardStream:
case PipeStream:
{
status=ferror(image->blob->file_info.file);
switch (image->blob->type)
{
case UndefinedStream:
+ case StandardStream:
break;
case FileStream:
- case StandardStream:
{
if (image->blob->synchronize != MagickFalse)
{
switch (image->blob->type)
{
case UndefinedStream:
+ case StandardStream:
break;
case FileStream:
- case StandardStream:
case PipeStream:
{
image->blob->eof=feof(image->blob->file_info.file) != 0 ? MagickTrue :
extent=image->blob->size;
break;
}
+ case StandardStream:
+ {
+ extent=image->blob->size;
+ break;
+ }
case FileStream:
{
if (fstat(fileno(image->blob->file_info.file),&image->blob->properties) == 0)
extent=(MagickSizeType) image->blob->properties.st_size;
break;
}
- case StandardStream:
case PipeStream:
{
extent=image->blob->size;
#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__OS2__)
if (strchr(type,'b') != (char *) NULL)
setmode(_fileno(image->blob->file_info.file),_O_BINARY);
+#endif
+ image->blob->type=StandardStream;
+ image->blob->exempt=MagickTrue;
+ return(MagickTrue);
+ }
+ if (LocaleNCompare(filename,"fd:",3) == 0)
+ {
+ char
+ mode[MaxTextExtent];
+
+ *mode=(*type);
+ mode[1]='\0';
+ image->blob->file_info.file=fdopen(StringToLong(filename+3),mode);
+#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__OS2__)
+ if (strchr(type,'b') != (char *) NULL)
+ setmode(_fileno(image->blob->file_info.file),_O_BINARY);
#endif
image->blob->type=StandardStream;
image->blob->exempt=MagickTrue;
{
case UndefinedStream:
break;
- case FileStream:
case StandardStream:
+ {
+ count=(ssize_t) read(fileno(image->blob->file_info.file),q,length);
+ break;
+ }
+ case FileStream:
case PipeStream:
{
switch (length)
{
case UndefinedStream:
break;
+ case StandardStream:
+ return(-1);
case FileStream:
{
if (fseek(image->blob->file_info.file,offset,whence) < 0)
image->blob->offset=TellBlob(image);
break;
}
- case StandardStream:
case PipeStream:
case ZipStream:
{
{
case UndefinedStream:
break;
+ case StandardStream:
+ return(MagickFalse);
case FileStream:
{
if (extent != (MagickSizeType) ((off_t) extent))
#endif
break;
}
- case StandardStream:
case PipeStream:
case ZipStream:
return(MagickFalse);
switch (image->blob->type)
{
case UndefinedStream:
+ case StandardStream:
break;
case FileStream:
- case StandardStream:
case PipeStream:
{
status=fflush(image->blob->file_info.file);
switch (image->blob->type)
{
case UndefinedStream:
+ case StandardStream:
break;
case FileStream:
{
offset=ftell(image->blob->file_info.file);
break;
}
- case StandardStream:
case PipeStream:
break;
case ZipStream:
{
case UndefinedStream:
break;
- case FileStream:
case StandardStream:
+ {
+ count=(ssize_t) write(fileno(image->blob->file_info.file),data,length);
+ break;
+ }
+ case FileStream:
case PipeStream:
{
switch (length)
"NotAuthorized","'%s'",read_info->filename);
return((Image *) NULL);
}
- if ((LocaleNCompare(filename,"fd:",3) == 0) &&
- (image_info->file == (FILE *) NULL))
- {
- read_info->file=fdopen(StringToLong(filename+3),"rb");
- SetImageInfoFile((ImageInfo *) image_info,read_info->file);
- }
/*
Call appropriate image reader based on image type.
*/
errno=EPERM;
ThrowBinaryException(PolicyError,"NotAuthorized",filename);
}
- if ((LocaleNCompare(filename,"fd:",3) == 0) &&
- (image_info->file == (FILE *) NULL))
- {
- write_info->file=fdopen(StringToLong(filename+3),"wb");
- SetImageInfoFile((ImageInfo *) image_info,write_info->file);
- }
/*
Call appropriate image reader based on image type.
*/