comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Creaty dummy.jpeg with Linux command
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Creaty dummy.jpeg with Linux command [message #90961 is a reply to message #90960] Tue, 19 May 2015 02:29 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Tuesday, May 19, 2015 at 11:20:12 AM UTC+2, Kai Heckel wrote:
> Am Dienstag, 19. Mai 2015 11:03:31 UTC+2 schrieb Helder:
>> On Tuesday, May 19, 2015 at 10:52:09 AM UTC+2, Kai Heckel wrote:
>>> Hey there!
>>>
>>> I'd like to create an empty dummy.jpeg using a Linux command.
>>>
>>> What I have is something like this:
>>>
>>> jpg_test = FILE_TEST(name+'*.jpg')
>>> IF jpg_test EQ 0 then begin
>>> spawn, 'touch '+file_dirs+'dummy.jpg'
>>> ENDIF
>>>
>>> -> "name" = predefined file name
>>> -> "file_dirs" = list of file diretories in which the dummy.jpeg should be copied in.
>>>
>>> The command seems right to me but the jpeg does not appear during the process...
>>>
>>> Any suggestions?
>>> Thanks
>>
>> Well, the command is right, meaning that if I type in a terminal
>> touch dummy.jpg
>> I do get the file. Therefore you must have made an error in the directory (file_dirs) and your looking for the file in the wrong place.
>> Why not just put a
>> print, file_dirs+'dummy.jpg'
>> after the spawn command.
>>
>> My guess: you forgot a forward slash after file_dirs, so that you're actually doing:
>> touch /home/thisisme/myoutputdummy.jpg
>> instead of
>> touch /home/thisisme/myoutput/dummy.jpg
>>
>> I hope it helps.
>> Helder
>
> I forgot to mention that I want to do this in IDL.
>
> What file_dirs look like is this --> F:\...\....\name\
>
> So it should put the jpeg below the "name" folder but it doens't

I got the point that you do this in IDL, but what spawn does is execute your command in the terminal, so you might as well test the command in the terminal and then import the exact same command in idl and use spawn.

It looks to me as if you've been working too long with windows. I also work with windows, but once in a while I do some stuff under linux and as far as I know you have to do the following changes when you use the paths:

windows:
c:\Mydirectory\
linux:
/Mydirectory

You see the differences? Here is a summary
1) linux uses no drive letter. So no "F:"
2) linux uses forward slash "/", windows backward slash "\"
3) because of 1), linux uses a path to address a drive... so something like this:
/myUsbStick/Mydirectory/

Things might be adapted in linux and the above are quite general.

IDL also gives you a hand in getting the right slash. Use the function path_sep() to get the right one automatically. So your IDL path should look like

mySep = path_sep()
myDir = 'home'+mySep+'thisisme'+mySep+'myoutput'+mySep+'dummy.jpg'

cheers
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Accessing class structure fields outside the class
Next Topic: How to include a scale bar (distance bar) on the Google Map Plot?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:52:42 PDT 2025

Total time taken to generate the page: 0.00266 seconds