<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MATLAB pour les geeks &#187; uigetfile</title>
	<atom:link href="https://blog.developpez.com/matlab4geek/?feed=rss2&#038;tag=uigetfile" rel="self" type="application/rss+xml" />
	<link>https://blog.developpez.com/matlab4geek</link>
	<description>&#62;&#62;why(393) </description>
	<lastBuildDate>Fri, 09 Jan 2015 13:05:12 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Big Issue en R2012b</title>
		<link>https://blog.developpez.com/matlab4geek/?p=377</link>
		<comments>https://blog.developpez.com/matlab4geek/?p=377#comments</comments>
		<pubDate>Fri, 28 Sep 2012 08:32:25 +0000</pubDate>
		<dc:creator><![CDATA[tug83]]></dc:creator>
				<category><![CDATA[R2012b]]></category>
		<category><![CDATA[8.0]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[bug r2012b]]></category>
		<category><![CDATA[dramatic]]></category>
		<category><![CDATA[exist]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[matlab 8.0]]></category>
		<category><![CDATA[PATH]]></category>
		<category><![CDATA[r2012b]]></category>
		<category><![CDATA[uigetfile]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/matlab4geek/?p=377</guid>
		<description><![CDATA[BIG BIG issue R2012b &#8211; Windows XP EDIT du 19 Décembre-2012 bug corrigé dans la Prerelase 2013a Alors si vous êtes en Windows XP Service Pack 3 et que vous avez téléchargé la R2012b , attention attention! Je crois avoir trouvé le bug du siècle avec EXIST après un UIGETFILE! Un truc de taré avec [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>BIG BIG issue R2012b &#8211; Windows XP </strong></p>
<p><em>EDIT du 19 Décembre-2012 bug corrigé dans la Prerelase 2013a</em></p>
<p>Alors si vous êtes en <strong>Windows XP </strong> Service Pack 3 et que vous avez téléchargé la <strong>R2012b</strong> , attention attention! Je crois avoir trouvé le bug du siècle avec EXIST après un <strong>UIGETFILE</strong>! </p>
<p>Un truc de taré avec un code simple à tester sur n&rsquo;importe quelle machine  avec la R2012b installée.<br />
Les fichiers trademarks.txt et patents.txt étant shippés avec tourtes les releases MATLAB.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">% go in a folder outside ML path <br />
cd(tempdir)<br />
<br />
% exist is going to return 0 (normal)<br />
exist('trademarks.txt')<br />
exist('patents.txt')<br />
<br />
% select any text file<br />
uigetfile(fullfile(matlabroot,'*.*'),'select any txt file')<br />
<br />
% here is the BUG <br />
% exist now returns 2 !!!<br />
exist('trademarks.txt') &nbsp;<br />
exist('patents.txt') <br />
<br />
% but now try which('trademarks.txt') or edit('trademarks.txt') !!</div></div>
<p>Bug <strong>reproduit plusieurs fois sur plusieurs machines Windows XP</strong>.<br />
Dans toutes les autres versions de MATLAB  <em>exist</em> retourne comme attendu ZERO.<br />
Sous Linux 12b le code raussi retourne ZERO.</p>
<p>Moi j&rsquo;ai eu ce souci avec des MAT-files qui n&rsquo;étaient pas sur mon path &#8230; alors vous voyez le truc : MATLAB vous dit que le fichier existe parce via un uigetfile il l&rsquo;a vu , mais ensuite vous ne pouvez rien faire avec ce fichier : ni l&rsquo;éditer , ni l&rsquo;effacer , ni appender des data &#8230; bref bug bug bug!!!!</p>
<p><span id="more-377"></span></p>
<p>Voilà le .m que j&rsquo;ai envoyé au support technique avec mes investigations &#8230;</p>
<p>Note <strong>avec UIGETDIR il n&rsquo;y a pas de problème</strong>.</p>
<p>%bug2ouf<br />
% Author Aurelien QUEFFURUST<br />
%<br />
% This  script is an easy example to reproduce an issue with MATLAB 8.0 (12b.)<br />
% As trademarks.txt , patents.txt are text files that every MATLAB user have<br />
% in his matlabroot directory, this script can be run by everybody.<br />
%<br />
%<br />
% What? :<br />
% The EXIST function in R2012b returns that a file exists (which is physically true)<br />
% but this file is neither in the current directory nor in MATLAB path<br />
% Issue are dramatic with this new behavior :<br />
% Since MATLAB tells you that the file  exists, you may want to edit it, find his path &#8230;.<br />
% here is the issue MATLAB tells you not found.<br />
%<br />
% My own investigation<br />
% Bug which can only be reproduced in R2012b.<br />
% I guess that the <strong>EXIST built-in which has changed in Feb 2012</strong> is the cause<br />
% of this issue.<br />
%<br />
%<br />
%<br />
% For investigation purposes this is my exist M-files :<br />
% &gt;&gt;which -all exist<br />
% built-in (F:\R2012b\toolbox\matlab\lang\@char\exist)    % char method<br />
% built-in (F:\R2012b\toolbox\matlab\lang\@double\exist)  % double method<br />
% F:\R2012b\toolbox\matlab\funfun\@inline\exist.m         % inline method<br />
%<br />
%  F is  Local disk.<br />
%<br />
% Date : 26-Sep-2012<br />
% Author Aurelien QUEFFURUST</p>
<p>%% GO outside matlabroot<br />
% To show that is not a PATH issue ,go in any folder outside matlabroot<br />
% , for example :<br />
cd(tempdir)<br />
%% the 2 following commands return the expected result : zero<br />
exist(&lsquo;trademarks.txt&rsquo;) % -&gt; 0<br />
exist(&lsquo;patents.txt&rsquo;) % -&gt;0<br />
%% now select any txt file<br />
uigetfile(fullfile(matlabroot,&rsquo;*.*&rsquo;),&rsquo;select any txt file&rsquo;)</p>
<p>%% First Unexpected result<br />
% even if they are not in the path  MATLAB now say that they exist !!<br />
exist(&lsquo;trademarks.txt&rsquo;)  % -&gt; returns 2 in R2012b<br />
exist(&lsquo;patents.txt&rsquo;) % -&gt; returns 2 in R2012b</p>
<p>%% Second Unexpected resultt<br />
% since exist return 2 , MATLAB should be able to tell me where the text file is:<br />
% instead MATLAB returns&rsquo;trademarks.txt&rsquo; not found.<br />
which(&lsquo;trademarks.txt&rsquo;) % -&gt; &lsquo;trademarks.txt&rsquo; not found.</p>
<p>% other example which will fail<br />
% delete trademarks.txt % -&gt; Warning: File &lsquo;trademarks.txt&rsquo; not found.<br />
% edit trademarks.txt  %-&gt; File &#8230; does not exist , Do you want to create it? &#8230;</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
